Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@jsenv/filesystem
Advanced tools
Collection of functions to interact with filesystem in Node.js
import { listFilesMatching } from "@jsenv/filesystem";
const jsFiles = await listFilesMatching({
directoryUrl: new URL("./", import.meta.url),
patterns: {
"./**/*.js": true,
"./**/*.test.js": false,
},
});
[
'file:///Users/dmail/docs/demo/a.js',
'file:///Users/dmail/docs/demo/b.js'
]
import { readFileSync } from "node:fs";
import { registerFileLifecycle } from "@jsenv/filesystem";
const packageJSONFileUrl = new URL("./package.json", import.meta.url);
let packageJSON = null;
const unregister = registerFileLifecycle(packageJSONFileUrl, {
added: () => {
packageJSON = JSON.parse(String(readFileSync(packageJSONFileUrl)));
},
updated: () => {
packageJSON = JSON.parse(String(readFileSync(packageJSONFileUrl)));
},
removed: () => {
packageJSON = null;
},
notifyExistent: true,
});
unregister(); // stop watching the file changes
import { registerDirectoryLifecycle } from "@jsenv/filesystem";
const directoryContentDescription = {};
const unregister = registerDirectoryLifecycle("file:///directory/", {
watchPatterns: {
"./**/*": true,
"./node_modules/": false,
},
added: ({ relativeUrl, type }) => {
directoryContentDescription[relativeUrl] = type;
},
removed: ({ relativeUrl }) => {
delete directoryContentDescription[relativeUrl];
},
});
unregister(); // stop watching the directory changes
npm install @jsenv/filesystem
FAQs
Collection of functions to interact with filesystem in Node.js
The npm package @jsenv/filesystem receives a total of 3 weekly downloads. As such, @jsenv/filesystem popularity was classified as not popular.
We found that @jsenv/filesystem 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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.