You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
idoctnef 52b63ee33a nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
..
.npmignore nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
History.md nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
Makefile nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
Readme.md nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
index.js nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago
package.json nodejs with express server, leapmotion for movement control, and threejs for 3d render 8 years ago

Readme.md

node-range-parser

Range header field parser.

Example:

assert(-1 == parse(200, 'bytes=500-20'));
assert(-2 == parse(200, 'bytes=malformed'));
parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }]));
parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }]));
parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }]));
parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }]));
parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }]));
parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }]));
parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }]));
parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }]));
parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }]));
parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }]));
parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }]));

Installation

$ npm install range-parser