Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@openfn/describe-package
Advanced tools
Utility for inspecting and describing an arbitrary npm package.
There is a demo project available in examples/compiler-worker.
import { Pack, Project, describeDts } from "@openfn/describe-package";
const project = new Project();
// Load a module from Unpkg
const pack = await Pack.fromUnpkg("@openfn/language-common@2.0.0-rc1");
const packageOrDts = /(?:package.json)|(?:\.d\.ts$)/i;
if (!pack.types) {
throw new Error(
`No 'types' field found for ${pack.specifier}`
);
}
// Download the `package.json` and `.d.ts` files.
const files = await pack.getFiles(
pack.fileListing.filter((path) => packageOrDts.test(path))
);
// Add the files to the Project filesystem.
project.addToFS(files);
// Add the types entrypoint (e.g. `index.d.ts`) as a 'project file'.
project.createFile(files.get(pack.types), pack.types);
// And finally get a list of exported members from a module.
const operations = describeDts(project, pack.types);
The Project
object is a wrapper around the Typescript compiler, providing
the necessary hooks to interact with code and module type definitions.
⛔ Not working currently.
const { startWorker } = await import("@openfn/describe-package/worker");
const worker = await startWorker();
const results = await worker.describeAdaptor("a .d.ts as a string");
There are three scripts:
pnpm test
pnpm run build
dist
and builds for packaging for npm.pnpm run watch
The Worker is built in two phases:
By splitting this up we can produce a single file that can be used in the browser.
FAQs
Utilities to inspect an npm package.
The npm package @openfn/describe-package receives a total of 615 weekly downloads. As such, @openfn/describe-package popularity was classified as not popular.
We found that @openfn/describe-package demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.