npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tello

v1.2.0

Published

Digests biscotto metadata

Downloads

173

Readme

Tello: A Donna metadata digest

Converts metadata from donna to an intermediate doc format using atomdoc as the docstring parser.

The tello format should be straightforward to convert into HTML. This project does not, and will not generate HTML.

Usage

Tello = require 'tello'

metadata = # get from donna!
telloFormat = Tello.digest(metadata)

From the command line

Generate metadata from donna, then:

donna -o . path/to/my/module
tello -i metadata.json -o api.json

Output

Here is an example output based on Scandal.PathSearcher:

{
  "classes": {
    "PathSearcher": {
      "name": "PathSearcher",
      "superClass": "EventEmitter",
      "filename": "src/path-searcher.coffee",
      "srcUrl": "https://github.com/atom/scandal/blob/v1.0.1/src/path-searcher.coffee#L88",
      "sections": [
        {
          "name": "Searching",
          "description": ""
        }
      ],
      "classMethods": [],
      "instanceMethods": [
        {
          "name": "constructor",
          "sectionName": null,
          "srcUrl": "https://github.com/atom/scandal/blob/v1.0.1/src/path-searcher.coffee#L97",
          "visibility": "Public",
          "summary": "Construct a {PathSearcher} object.",
          "description": "Construct a {PathSearcher} object.",
          "arguments": [
            {
              "children": [
                {
                  "name": "maxLineLength",
                  "description": "{Number} default `100`; The max length of the `lineText`  component in a results object. `lineText` is the context around the matched text.",
                  "type": "Number",
                  "isOptional": false
                },
                {
                  "name": "wordBreakRegex",
                  "description": "{RegExp} default `/[ \\r\\n\\t;:?=&\\/]/`;  Used to break on a word when finding the context for a match. ",
                  "type": "RegExp",
                  "isOptional": false
                }
              ],
              "name": "options",
              "description": "{Object}",
              "type": "Object",
              "isOptional": false
            }
          ]
        },
        {
          "name": "searchPaths",
          "sectionName": "Searching",
          "srcUrl": "https://github.com/atom/scandal/blob/v1.0.1/src/path-searcher.coffee#L118",
          "visibility": "Public",
          "summary": "Search an array of paths.",
          "description": "Search an array of paths.\n\nWill search with a {ChunkedExecutor} so as not to immediately exhaust all\nthe available file descriptors. The {ChunkedExecutor} will execute 20 paths\nconcurrently.",
          "arguments": [
            {
              "name": "regex",
              "description": "{RegExp} search pattern",
              "type": "RegExp",
              "isOptional": false
            },
            {
              "name": "paths",
              "description": "{Array} of {String} file paths to search",
              "type": "Array",
              "isOptional": false
            },
            {
              "children": [
                {
                  "name": "results",
                  "description": "{Array} of Result objects in the format specified above;  null when there are no results",
                  "type": "Array",
                  "isOptional": false
                },
                {
                  "name": "errors",
                  "description": "{Array} of errors; null when there are no errors. Errors will  be js Error objects with `message`, `stack`, etc. ",
                  "type": "Array",
                  "isOptional": false
                }
              ],
              "name": "doneCallback",
              "description": "called when searching the entire array of paths has finished",
              "type": null,
              "isOptional": false
            }
          ]
        },
        {
          "name": "searchPath",
          "sectionName": "Searching",
          "srcUrl": "https://github.com/atom/scandal/blob/v1.0.1/src/path-searcher.coffee#L144",
          "visibility": "Public",
          "summary": "Search a file path for a regex",
          "description": "Search a file path for a regex",
          "arguments": [
            {
              "name": "regex",
              "description": "{RegExp} search pattern",
              "type": "RegExp",
              "isOptional": false
            },
            {
              "name": "filePath",
              "description": "{String} file path to search",
              "type": "String",
              "isOptional": false
            },
            {
              "children": [
                {
                  "name": "results",
                  "description": "{Array} of Result objects in the format specified above;  null when there are no results",
                  "type": "Array",
                  "isOptional": false
                },
                {
                  "name": "error",
                  "description": "{Error}; null when there is no error ",
                  "type": "Error",
                  "isOptional": false
                }
              ],
              "name": "doneCallback",
              "description": "called when searching the entire array of paths has finished",
              "type": null,
              "isOptional": false
            }
          ]
        }
      ],
      "classProperties": [],
      "instanceProperties": [],
      "visibility": "Public",
      "summary": "Will search through paths specified for a regex.",
      "description": "Will search through paths specified for a regex.\n\nLike the {PathScanner} the {PathSearcher} keeps no state. You need to consume\nresults via the done callbacks or events.\n\nFile reading is fast and memory efficient. It reads in 10k chunks and writes\nover each previous chunk. Small object creation is kept to a minimum during\nthe read to make light use of the GC.",
      "events": [
        {
          "name": "results-found",
          "summary": "Fired when searching for a each path has been completed and matches were found.",
          "description": "Fired when searching for a each path has been completed and matches were found.",
          "visibility": "Private",
          "arguments": [
            {
              "name": "results",
              "description": "{Object} in the result format:\n```js\n{\n  \"path\": \"/Some/path.txt\",\n  \"matches\": [{\n    \"matchText\": \"Text\",\n    \"lineText\": \"Text in this file!\",\n    \"lineTextOffset\": 0,\n    \"range\": [[9, 0], [9, 4]]\n  }]\n}\n```",
              "type": "Object",
              "isOptional": false
            }
          ]
        },
        {
          "name": "results-not-found",
          "summary": "Fired when searching for a path has finished and _no_ matches were found.",
          "description": "Fired when searching for a path has finished and _no_ matches were found.",
          "visibility": "Private",
          "arguments": [
            {
              "name": "filePath",
              "description": "path to the file nothing was found in `\"/Some/path.txt\"`",
              "type": null,
              "isOptional": false
            }
          ]
        },
        {
          "name": "file-error",
          "summary": "Fired when an error occurred when searching a file. Happens for example when a file cannot be opened.",
          "description": "Fired when an error occurred when searching a file. Happens for example when a file cannot be opened.",
          "visibility": "Private",
          "arguments": [
            {
              "name": "error",
              "description": "{Error} object",
              "type": "Error",
              "isOptional": false
            }
          ]
        }
      ],
      "examples": [
        {
          "description": "",
          "lang": "coffee",
          "code": "{PathSearcher} = require 'scandal'\nsearcher = new PathSearcher()\n\n# You can subscribe to a `results-found` event\nsearcher.on 'results-found', (result) ->\n  # result will contain all the matches for a single path\n  console.log(\"Single Path's Results\", result)\n\n# Search a list of paths\nsearcher.searchPaths /text/gi, ['/Some/path', ...], (results) ->\n  console.log('Done Searching', results)\n\n# Search a single path\nsearcher.searchPath /text/gi, '/Some/path', (result) ->\n  console.log('Done Searching', result)",
          "raw": "```coffee\n{PathSearcher} = require 'scandal'\nsearcher = new PathSearcher()\n\n# You can subscribe to a `results-found` event\nsearcher.on 'results-found', (result) ->\n  # result will contain all the matches for a single path\n  console.log(\"Single Path's Results\", result)\n\n# Search a list of paths\nsearcher.searchPaths /text/gi, ['/Some/path', ...], (results) ->\n  console.log('Done Searching', results)\n\n# Search a single path\nsearcher.searchPath /text/gi, '/Some/path', (result) ->\n  console.log('Done Searching', result)\n```"
        },
        {
          "description": "A results from line 10 (1 based) are in the following format:",
          "lang": "js",
          "code": "{\n  \"path\": \"/Some/path\",\n  \"matches\": [{\n    \"matchText\": \"Text\",\n    \"lineText\": \"Text in this file!\",\n    \"lineTextOffset\": 0,\n    \"range\": [[9, 0], [9, 4]]\n  }]\n}",
          "raw": "```js\n{\n  \"path\": \"/Some/path\",\n  \"matches\": [{\n    \"matchText\": \"Text\",\n    \"lineText\": \"Text in this file!\",\n    \"lineTextOffset\": 0,\n    \"range\": [[9, 0], [9, 4]]\n  }]\n}\n```"
        }
      ]
    }
  }
}