Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
pretty-range
Advanced tools
Simple Node.js module to prettify arrays of integers into ranges. This code is based upon a StackOverflow post by Christian C. Salvadó.
Here are a few examples:
[1,2,3]
-> "1-3"
[1,2,3,5,6,7]
-> "1-3, 5-7"
[1,2,5,6,7]
-> "1, 2, 5-7"
[7,5,6,3,4,10]
-> "3-7, 10"
npm install pretty-range
var prettyRange = require("pretty-range");
var input = [7,5,6,3,4,10];
var output = prettyRange(input);
console.log(output);
The outputs is 3-7, 10
If you're using Express and want access to prettyRange() in your views, add the following piece of middleware to your server:
var prettyRange = require("pretty-range");
var express = require("express");
var app = express.createServer();
app.use(prettyRange.middleware);
FAQs
Node module to prettify arrays of integers into ranges.
The npm package pretty-range receives a total of 1 weekly downloads. As such, pretty-range popularity was classified as not popular.
We found that pretty-range demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.