You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@openfn/doclet-query

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfn/doclet-query

JSDoc Metadata Query Tools

0.0.3
latest
npmnpm
Version published
Weekly downloads
1
-97.37%
Maintainers
3
Weekly downloads
 
Created
Source

doclet-query

CircleCI

JSDoc Metadata Query Tools

EXPERIMENTAL Like life itself, it's very likely to change.

Usage

  • Get a dump of doclets from JSDoc.
    Easiest way is to use jsdoc-api.

    const jsdoc = require('jsdoc-api');
    const { createTree } = require('./src');
    
    jsdoc.explain({
      files: '../package-name/src/*',
      package: '../package-name/package.json'
    }).then(function(result) {
      const tree = createTree(result);
      console.log(tree['package-name'].modules.foo.exports)
    })
    

    or

    You can use the "explain" switch from the JSDoc CLI:
    jsdoc src -r -P package.json -X > doclets.json

  • Using the jsdoc-query API call createTree with the doclets data.

const doclets = require('./doclets.json');
const { createTree } = require('doclet-query');
const tree = createTree(doclets);
  • Starting from the package, you can traverse the module's structure:
const package = tree['package-name']        // The package
const modules = package.modules             // Modules found in the package
const exportedMembers = modules.foo.exports // Exported members of the module

FAQs

Package last updated on 30 Apr 2021

Did you know?

Socket

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.