Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

shuffle-words

jonschlinkert5.6k0.1.2

Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.

algorithm, benchmarking, combinatorics, efficient, equally, finite, fisher, fixtures, knuth, letters, permutation, random, randomly, randomize, randomizer, replacement, samples, set, shuffle, shuffled, shuffling, string, terms, test, unbiased, word, words, yates

readme

shuffle-words NPM version

Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.

Install

Install with npm:

npm i shuffle-words --save-dev

Run tests

npm test

Usage

var shuffle = require('shuffle-words');

shuffle('foo bar baz');
//=> 'baz foo bar'

Shuffle letters and words:

shuffle('foo bar baz', true);
//=> 'zba rba ofo'

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license


This file was generated by verb-cli on October 02, 2014.