Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Counts the number of items in an async iterable
Counts the number of items in an (async)iterable.
N.b. will consume the iterable
import length from 'it-length'
// This can also be an iterator, generator, etc
const values = [0, 1, 2, 3, 4]
const res = length(values)
console.info(res) // 5
Async sources must be awaited:
import length from 'it-length'
const values = async function * () {
yield * [0, 1, 2, 3, 4]
}
const res = await length(values())
console.info(res) // 5
$ npm i it-length
<script>
tagLoading this module through a script tag will make it's exports available as ItLength
in the global namespace.
<script src="https://unpkg.com/it-length/dist/index.min.js"></script>
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Counts the number of items in an async iterable
The npm package it-length receives a total of 10,592 weekly downloads. As such, it-length popularity was classified as popular.
We found that it-length demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.