Catalog npm
Back to packageRELEASE DETAILS

1.0.0

npm

2d-array

Transform a 1d array into a 2d array

Published12 Oct 2015
Direct dependencies4
Transitive dependenciesNot calculated

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.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
istanbul
Environment
{
  "local_name": "istanbul",
  "alias": false,
  "peer_metadata": null
}
^0.3.22development
jscs
Environment
{
  "local_name": "jscs",
  "alias": false,
  "peer_metadata": null
}
^2.3.0development
jshint
Environment
{
  "local_name": "jshint",
  "alias": false,
  "peer_metadata": null
}
^2.8.0development
mocha
Environment
{
  "local_name": "mocha",
  "alias": false,
  "peer_metadata": null
}
^2.3.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "176cb88653b846715f1534440d549182083f61b0",
  "tarball": "https://registry.npmjs.org/2d-array/-/2d-array-1.0.0.tgz",
  "integrity": "sha512-NWz9DJ+a02sHLYOWQ0CHZ4dy0CRFdgIu2wntqZQzFufvIXp260qpoKLs92X21hZBR8k6eV8pnx8zUslmNP76ng==",
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEYCIQCkPBog5TkNvCutsMilB2aJ5I5b4P959kkA3YLlESawlgIhAPcsOquaB8GxK18le+Omn1szss1qKFgVbnGfNW3FT+EN"
    }
  ]
}

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_version:c9b44ebcc3cd685ac6edc2aa123f01b7d6d280b4d95b3fb8cf12c78e63535c99

Other collected versions

0.0.116 MayView all collected versions →