Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@bramus/range
Advanced tools
Create an array containing a range of elements (cfr. PHP's range)
npm i @bramus/range
import { range } from '@bramus/range';
const r1 = range(0, 12);
// ~> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
const r2 = range(7, 12);
// ~> [7, 8, 9, 10, 11, 12]
const r3 = range(0, 100, 10);
// ~> [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
🔗 Try it out online in the playground: https://codepen.io/bramus/pen/dyVMPxV
The exposed function has an API identical to PHP's range
method:
range(start, end, step = 1);
Parameters:
start
: First value of the sequence.end
: The sequence is ended upon reaching the end
value.step
(default: 1): If a step
value is given, it will be used as the increment between elements in the sequence. step
should be given as a positive number. If not specified, step will default to 1
.Unlike PHP's range
, this function is limited to numbers only. In case you do want to get letters, combine range()
with Array.map()
.
@bramus/range
is released under the MIT public license. See the enclosed LICENSE
for details.
FAQs
Create an array containing a range of elements (cfr. PHP's range)
The npm package @bramus/range receives a total of 2,346 weekly downloads. As such, @bramus/range popularity was classified as popular.
We found that @bramus/range 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.