Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@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 231 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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.