
Security News
High Salaries No Longer Enough to Attract Top Cybersecurity Talent
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
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 3,961 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
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.
Security News
Corepack will be phased out from future Node.js releases following a TSC vote.