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

tomo

v1.0.0-alpha.3

Published

A small generic scanner and parser written in TypeScript for Node and the web

Downloads

6

Readme

tomo

A small generic scanner and parser written in TypeScript for Node and the web.

Note: Not production ready!

Build Status npm npm GitHub license Join the chat at https://gitter.im/iwatakeshi/tomo

Background

tomo is a small generic lexer and parser that started out of curiousity on how lexers and parsers work. In addition to my curiosity, a discussion appeared on Mr. Doc's issue about creating a parser that replaces Mr. Doc's current core (Dox) and tomo is the result from the discussion. If this succeeds, it will mean that Mr. Doc can generate documentation for any language*. Of course, tomo can be used for other things such as a text editor, etc.

* It will depend on the parser.

Usage

npm i --save tomo

tomo contains 3 main classes and 1 module that makes up the lexer and parser combo: Source, Scanner, Parser, and Token respectively.

The Source class initializes a new source object which provides the essential methods to the Scanner class to begin the tokenization process. To tokenize, one must pass a callback function to scan that tokenizes the source. Once it has finished the tokenization process, it wraps the tokens into a Token stream which the TokenStream class (in the Token module) provides a few helper methods to access the tokens.

The Token class (in the Token module) provides the essentials to describe the scanned characters. Token.ts exports two modules which is the TokenType: enum, and the Token class. See Token.ts

The Parser class ( Help Needed ) should parse the tokens and return an AST.

As the descriptions says, tomo can be used in the web browser. The library is bundled using browserify and all classes have no external dependency (npm modules) other than the tomo classes. You may simply add the source from dist/ into your html file and use it as you normally would. Note that the source is not minified at the moment.

Example

See example on rawgit.

# Install modules
npm i

# Run the example file
npm start

Documentation

Documentation can be found at the GitHub Page

Develop

Contributions are gladly accepted. tomo uses Typescript and the source files are located under the src/ directory.

To build the files, run gulp.