Socket
Socket
Sign inDemoInstall

baraja

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    baraja

Shuffle, just about anything!


Version published
Weekly downloads
4
increased by300%
Maintainers
1
Install size
38.3 kB
Created
Weekly downloads
 

Readme

Source

baraja

Build Status Dependency status Downloads Always useful

Shuffle, just about anything!

Install

npm install --save baraja

Use

const baraja = require('baraja');

API

.weave(array, sort) -> {String}

Weave multiple strings into one.
array: An array of strings to be weave into one.
sort: asc || desc - Order strings by length before weaving them.

const baraja = require('baraja');

baraja.weave([
  'hello',
  'developer',
  'friends'
]);
// 'hdfeerlvileeolnopders'

baraja.weave([
  'hello',
  'developer',
  'friends'
], 'asc');
// 'hfderelivleeonldsoper'

baraja.weave([
  'hello',
  'developer',
  'friends'
], 'desc');
// 'dfherevileellnoodpser'
.across(array) -> {Object}

Cross shuffle a list of words.
The input array is always sorted alphabetically.
array: An array of strings to be shuffled across.

const baraja = require('baraja');

baraja.across([
  'Peter',
  'Paul',
  'Merry',
  'Andrew'
]);
// {
    "Andrew": "Merry",
    "Merry": "Paul",
    "Paul": "Peter",
    "Peter": "Andrew"
}

Contribute

fork https://github.com/aichholzer/baraja/

License

MIT

Keywords

FAQs

Last updated on 08 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc