Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including multi-integer-range with all npm packages installed. Try it out:

const { MultiRange, multirange } = require('multi-integer-range'); // Just a nice shorthand for you const mr = value => multirange(value, { parseUnbounded: true, parseNegative: true }); // Basic manipulation const range = mr('1-5, 9, 8') .append(10) .subtract(1); console.log(range.toString()); // Iterator & array spread console.log([...mr('(-103)-(-100), 101-103')]);

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

multi-integer-range v4.0.8

Parses and manipulates multiple comma-separated integer ranges (eg 1-3,8-10)

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free