Catalog npm
PACKAGE EXPLORERView in registry

2d-array

npm

Transform a 1d array into a 2d array

Versions collected2
Direct dependencies4From release 1.0.0
Last observed20 Oct, 19:09 UTC

README

Current package documentation

2d-array

Transform a 1d array into a 2d array

build status

Installation

npm install 2d-array --save

Usage

var create2dArray = require('2d-array')

console.log(create2dArray([ 1, 2, 3, 4, 5, 6 ], 2))
// -> [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ]

console.log(create2dArray([ 1, 2, 3, 4], 2, 2))
// -> [ [ 1 ], [ 2, 3 ] ]

var array = create2dArray(array, n[, ignore])

Options must include:

  • array - an array to transform into a 2d array.
  • n - the number of items to be inside each array. Non-numbers (undefined, null, ''), Non-floats or strings that represent anything other than one number will return an empty array.
  • 'ignore' - Optional - When set, deletes the value specified from any array containing that value.

Credits

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 2

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest12 Oct 20154
0.0.116 May 20144

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
domharrington/2d-array

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e3265551e6370670aef95cf5e4d7fd1813f1050454d640480fad4f4b369ad670