Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
doctrine-file
Advanced tools
You can install Doctrine-File using npm:
$ npm install doctrine-file --save-dev
Import doctrine-File inside of your JavaScript:
import { parseFile, parseFileContent } from 'doctrine-file';
file
String PathName to a textfileoptions
Object
callback
FunctionThe callback is passed two arguments (err, comments)
, where comments
is an array of doctrine results.
If no JSDocs can be extracted from the file, the array will be empty.
When the file cannot be read err
will contain the Error
.
Here's a simple example:
parseFile('somefile.js', (err, comments) => {
if (err) throw err;
comments.forEach(console.log);
});
content
String | Buffer Content of a complete file to be parsedoptions
Object
Here's a simple example:
const content = fs.readFileSync('somefile.js', 'utf-8');
const comments = parseFileContent(content);
comments.forEach(console.log);
doctrine-file is licensed under the MIT license.
FAQs
File-Reader for the Doctrine JSDoc Parser
The npm package doctrine-file receives a total of 4,989 weekly downloads. As such, doctrine-file popularity was classified as popular.
We found that doctrine-file demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.