All Projects → jshttp → Range Parser

jshttp / Range Parser

Licence: mit
Range header field parser

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Range Parser

Nanorange
Range-based goodness for C++17
Stars: ✭ 297 (+280.77%)
Mutual labels:  range
Period
PHP's time range API
Stars: ✭ 616 (+689.74%)
Mutual labels:  range
Quadtree Js
A simple quadtree implementation for javascript and typescript (nodejs or browser).
Stars: ✭ 36 (-53.85%)
Mutual labels:  range
Web Highlighter
✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️
Stars: ✭ 373 (+378.21%)
Mutual labels:  range
React Range
🎚️Range input with a slider. Accessible. Bring your own styles and markup.
Stars: ✭ 545 (+598.72%)
Mutual labels:  range
Depth clustering
🚕 Fast and robust clustering of point clouds generated with a Velodyne sensor.
Stars: ✭ 657 (+742.31%)
Mutual labels:  range
Range V3
Range library for C++14/17/20, basis for C++20's std::ranges
Stars: ✭ 3,231 (+4042.31%)
Mutual labels:  range
Range Slider
The simplest JavaScript custom range slider ever!
Stars: ✭ 41 (-47.44%)
Mutual labels:  range
Traces.vim
Range, pattern and substitute preview for Vim
Stars: ✭ 568 (+628.21%)
Mutual labels:  range
Angular Datetime Range
📅 Angular directive for datetime range input
Stars: ✭ 27 (-65.38%)
Mutual labels:  range
React Infinite Calendar
✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.
Stars: ✭ 3,828 (+4807.69%)
Mutual labels:  range
Ion2 Calendar
📅 A date picker components for ionic2 /ionic3 / ionic4
Stars: ✭ 537 (+588.46%)
Mutual labels:  range
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (+806.41%)
Mutual labels:  range
Android Slidr
Another android slider / seekbar, but different :-)
Stars: ✭ 326 (+317.95%)
Mutual labels:  range
Fieldtop
Finds near-overflow columns in MySQL databases
Stars: ✭ 36 (-53.85%)
Mutual labels:  range
Deskapp
DeskApp Admin is a free to use Bootstrap 4 admin template.
Stars: ✭ 296 (+279.49%)
Mutual labels:  range
React Slider
Accessible, CSS agnostic, slider component for React.
Stars: ✭ 627 (+703.85%)
Mutual labels:  range
Persianrangedatepicker
Persian range date picker for android.
Stars: ✭ 48 (-38.46%)
Mutual labels:  range
Fill Range
Fill in a range of numbers or letters, positive or negative, optionally passing an increment or multiplier to use.
Stars: ✭ 41 (-47.44%)
Mutual labels:  range
Singledateandtimepicker
You can now select a date and a time with only one widget !
Stars: ✭ 921 (+1080.77%)
Mutual labels:  range

range-parser

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Range header field parser.

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install range-parser

API

var parseRange = require('range-parser')

parseRange(size, header, options)

Parse the given header string where size is the size of the selected representation that is to be partitioned into subranges. An array of subranges will be returned or negative numbers indicating an error parsing.

  • -2 signals a malformed header string
  • -1 signals an unsatisfiable range
// parse header from request
var subranges = parseRange(size, req.headers.range)

// the type of the subranges
if (subranges.type === 'bytes') {
  // the ranges
  subranges.forEach(function (r) {
    // do something with r.start and r.end
  })
}

Options

These properties are accepted in the options object.

combine

Specifies if overlapping & adjacent subranges should be combined, defaults to false. When true, ranges will be combined and returned as if they were specified that way in the header.

parseRange(100, 'bytes=50-55,0-10,5-10,56-60', { combine: true })
// => [
//      { start: 0,  end: 10 },
//      { start: 50, end: 60 }
//    ]

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].