
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Parse integers from comma separated string, including ranges.
var test = require('tape');
var parseInts = require('parse-ints');
var ints;
test('parses a comma separated strings', function (t) {
t.plan(2);
ints = parseInts('1,2,3');
t.same(ints, [ 1, 2, 3 ]);
// with radix
ints = parseInts('101,1010,1111', 2);
t.same(ints, [ 5, 10, 15 ]);
});
test('parses hyphenated strings into a range', function (t) {
t.plan(2);
ints = parseInts('1-3');
t.same(ints, [ 1, 2, 3 ]);
// with radix
ints = parseInts('101-111', 2);
t.same(ints, [ 5, 6, 7 ]);
});
test('parses mixed strings', function (t) {
t.plan(2);
ints = parseInts('1-3, 7, 9-10');
t.same(ints, [ 1, 2, 3, 7, 9, 10 ]);
// with radix
ints = parseInts('101-111, 1010', 2);
t.same(ints, [ 5, 6, 7, 10 ]);
});
FAQs
Parse integers from comma separated string, including ranges.
We found that parse-ints demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.