Socket
Socket
Sign inDemoInstall

anno

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    anno

A parser for embedded annotations of functions and modules


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Install size
7.68 kB
Created
Weekly downloads
 

Readme

Source

Anno

A parser for embedded annotations of functions and modules

Build Status Coverage Status Dependency Status Dependency Status

Anno parses DocBlocks, ignores any regular comment, and returns an object containing the parsed annotations.

Installation

npm install anno --save-dev

Usage

/**
 * This function does something.
 * @hello world
 * @valueless
 */
function doSomething () {
  console.log('Did something.');
}
var anno = require('anno');
var result = anno(fs.readFileSync('test.js', 'utf8'));
  console.log(result);
});
{
  "doSomething": {
    "hello": "world",
    "valueless": true
  }
}

Supported syntax

  • function <name> (…) { … }
  • var <name> = function (…) { … }
  • let <name> = function (…) { … }
  • const <name> = function (…) { … }
  • var <name> = new Function (…)
  • let <name> = new Function (…)
  • const <name> = new Function (…)
  • var <name> = (…) => { … }
  • let <name> = (…) => { … }
  • const <name> = (…) => { … }
  • module.exports = function (…) { … }
  • exports.<name> = function (…) { … }
  • exports[<name>] = function (…) { … }

Changelog

  • 0.0.2
    • README fixes
  • 0.0.1
    • Initial version

License

Copyright (c) 2016 Thomas Rasshofer
Licensed under the MIT license.

See LICENSE for more info.

Keywords

FAQs

Last updated on 23 Mar 2016

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