Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reference

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reference

Generate documentation from JSON.

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by133.33%
Maintainers
1
Weekly downloads
 
Created
Source

reference.js

Generate a simple API reference from JSON. Made specifically for PeerJS, so it probably won't suit your needs.

Expected style

The name property is required. Everything else is optional. Anchor IDs will correspond to the nesting of the current property (e.g. Some Class -> klass#method -> argument has an ID of some_class-klassmethod-argument).

[
  {
    "name": "TopLevelClass",
    "type": "constructor",
    "description": "This class does some stuff.",
    "snippet": "var klass = new TopLevelClass(arg1, [callback]);",
    "children": [
      {
        "name": "arg1",
        "type": "string",
        "description": "This is an argument for the constructor."
      },
      {
        "name": "callback",
        "type": "function",
        "description": "This is an optional callback.",
        "optional": true,
        "children": {
          "name": "err",
          "type": "error",
          "description": "Will callback with an error if you messed up."
        }
      }
    ]
  },
  {
    "name": "AnotherTopLevelClass",
    "type": "constructor",
    "description": "This class does some other stuff.",
    "snippet": "var klass2 = new AnotherTopLevelClass(options);",
    "children": {
      "name": "options",
      "type": "object",
      "description": "This is a hash of options for AnotherTopLevelClass.",
      "children": [
        {
          "name": "option1",
          "description": "This is anything, really."
        },
        {
          "name": "option2",
          "description": "This is just really another option."
        }
      ]
    }
  }
]

The above should give you something like this:

Generate PeerJS demo

cd demo
npm install
node demo.js

FAQs

Package last updated on 15 Sep 2013

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc