
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
functional documents for node.
functional documents (a function that returns a document) combines watching changes, document parsing and proxy.
documents only reload if changed and when requested, external changes only flag the file to refresh at next request.
var myfile=require("lazy-docs")()("test/resources/test.txt");
console.log(myfile());//sync mode
myfile((e,o)=>console.log("content:",e||o));//assync mode
this module only exports a setup function, on setup a file creator function is returned. The file creator function should be used to create functional files
require("lazy-docs")([loader function]);
where
loader function is optional (default to text load) and should be a function to parse the document from a string/buffer.
This will return a document loader function that expects a filename.
require("lazy-docs")(parser)(filename)
where
filename is a file name string
The loader function will return a functional document. You can associate it with a variable or call it directly
//default parser
var myfile=require("lazy-docs")(/*use default parser*/)("test/resources/test.txt");
then the file can be recalled and will update himself in case of external change
console.log(myfile());//sync mode
myfile(o=>console.log("content:",o));//assync mode
text documents loader
var txtDoc=require('lazy-docs')();//setup for text format
var txt=txtDoc("test/resources/test.txt");//functional file
console.log(txt());//sync file content with cache and watcher
txt(o=>console.log(o));//assync file content with cache and watcher
libxmljs documents loader
var libxml=require('libxmljs');
var xmlDoc=require('lazy-docs')(libxml.parseXml);//setup for libxml documents
var xml=xmlDoc("test/resources/test.xml");
console.log(xml().toString());
closing a document stops watching the file, if you recall the document it will load and watch again
var file=require("lazy-docs")()("myfile.txt");
console.log(file());//print updated text file content
file.proxy.close();//stop watching the file
TODO LIST:
this module defaults to local sync/assync file system, see fProxy for more flexibility
FAQs
Lazy document proxy with watcher
We found that lazy-docs 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.