0.1.1 • Published 9 years ago

slice-file-cli v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

slice-file-cli NPM version

Generate a module that manually slices between a given range.

$ slice-file 0 5 > slice.js
const slice = require('./slice')

slice([1, 2, 3, 4], 1)
// => [2, 3, 4]

This generates a file that manually picks apart an array between a given range.

Reconsider if you want to use this, as I'm not sure it is a good practice... I just made this because I was bored.

Installation

$ npm install --save slice-file-cli

Usage

slice-file start end

Generate a module that slices manually through the given range.

  • start: The starting index of the range where to slice manually.
  • end: The ending index of the range.

Outputs the module via STDOUT.

$ slice-file 1 10 > slice.js

slice(input, [start])

The exported module's function.

  • input (Array): An array you want to slice.
  • start (Number): The starting index.
slice([1, 2, 3, 4, 5, 6], 2)
// => [3, 4, 5, 6]

License

MIT © Jamen Marz