slice-file-cli

0.1.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i slice-file-cli

Weekly Downloads

0

Version

0.1.1

License

MIT

Last publish

Collaborators

  • npm