Socket
Socket
Sign inDemoInstall

doctrine-file

Package Overview
Dependencies
2
Maintainers
8
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    doctrine-file

File-Reader for the Doctrine JSDoc Parser


Version published
Maintainers
8
Install size
166 kB
Created

Changelog

Source

2.0.1 (2018-06-09)

Bug Fixes

  • babel: Do not compile and publish tests (b6d7d11)

<a name="2.0.0"></a>

Readme

Source

Doctrine-File

File-Reader for the Doctrine JSDoc Parser

Build Status codecov

Installation

You can install Doctrine-File using npm:

$ npm install doctrine-file --save-dev

Usage

Import doctrine-File inside of your JavaScript:

import { parseFile, parseFileContent } from 'doctrine-file';

parseFile(file[, options], callback)

  • file String PathName to a textfile
  • options Object
    • All options that doctrine.parse supports, except unwrap which can't be changed.
  • callback Function

The 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);
});

parseFileContent(content[, options])

  • content String | Buffer Content of a complete file to be parsed
  • options Object
    • All options that doctrine.parse supports, except unwrap which can't be changed.

Here's a simple example:

const content = fs.readFileSync('somefile.js', 'utf-8');

const comments = parseFileContent(content);

comments.forEach(console.log);

License

doctrine-file is licensed under the MIT license.

Keywords

FAQs

Last updated on 09 Jun 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc