Skip to content

jkroso/read-slice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

read-slice

read part of a file

Installation

With npm

$ npm install read-slice --save

then in your app:

var slice = require('read-slice')

API

slice(file:String, from:Number, to:Number)

read a portion of file. slice returns a Result though you can access the internal callback based implemenation as slice.plain

Example

the head(1) executable can be loosly emulated by defining head as

function head(file){
  slice(file, 0, 100).read(function(buffer){
    console.log(buffer.toString('utf8'))
  })
}

Running the tests

$ make test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published