How to use the multi-integer-range.multirange function in multi-integer-range

To help you get started, we’ve selected a few multi-integer-range examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github micnews / story-json-to-video / bin / cli.js View on Github external
console.log('  --save-poster-images     Save first frame of each page as image');
  process.exit(1);
}

if (argv.help) {
  usage();
}

const input = argv._[0];
if (!input) {
  usage();
}

let pagesRange = null;
try {
  pagesRange = multirange(
    argv.pages || '0-',
    { parseUnbounded: true },
  );
} catch (e) {
  console.error('Invalid pages range');
  process.exit(1);
}

let json;
try {
  json = JSON.parse(fs.readFileSync(input, 'utf8'));
} catch (e) {
  console.error(`Unable to load json ${input}`);
  process.exit(1);
}
github smikitky / node-multi-integer-range / example.js View on Github external
const mr = value =>
  multirange(value, { parseUnbounded: true, parseNegative: true });

multi-integer-range

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

MIT
Latest version published 2 years ago

Package Health Score

47 / 100
Full package analysis