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

inferjs-compiler

v0.0.9

Published

A compiler that processes JSDoc comments into an InferObject File for utilizing with the InferJS Library.

Downloads

9

Readme

InferJS Library

Heading  InferJS-Compiler: Overview

A compiler that processes JSDoc comments into an InferObject file, for utilizing with the InferJS-Library. The InferJS-Compiler is part of a bigger project called InferJS. The compiler can be used for other third party projects, that may need to interpret JSDoc comments into JSON type files.

Built With

Heading  InferJS-Compiler: Installation

To install the latest version of InferJS-Compiler locally with npm:

Install: Locally

npm install inferjs-compiler --save

Install: Globally

npm install -g inferjs-compiler 

Optional: If you would like to download the repo source code with git:

git clone https://github.com/Codevendor/inferjs-compiler.git

Heading  InferJS-Compiler: CLI Usage

To use the InferJS-Compiler from the command line and create InferObjects, please use the following commands.

# Global: CLI Run Format - InferJS-Compiler Globally Installed: 
inferjs-compiler <cmd> <input> <inputOptions> <outputOptions> -o <output>

# or

# Local: CLI Node Run Format - InferJS-Compiler Not Globally Installed
node <path/to/inferjs-compiler> <cmd> <input> <inputOptions> <outputOptions> -o <output>

InferJS-Compiler: parse-files

| Action                   |Cmd| Description | | :-- | :--: | :-- |
| parse-files | -f | Parses single or multiple JavaScript files or directories, looking for JSDoc multi-line comments. Parses the JSDoc comments into an InferObject, that can be outputed to the terminal or specified output file. |

Example - Parse Single Input File to Terminal Output:

foo@console:~$: inferjs-compiler -f ./path/test1.js -o  

Example - Parse Single Input File to Output File:

foo@console:~$: inferjs-compiler -f ./path/test1.js -o ./path/infer-object.js

Example - Parse Multiple Input Files to Terminal Output:

foo@console:~$: inferjs-compiler -f ./path/test1.js ./path/test2.js -o 

Example - Parse Multiple Input Files to Output File:

foo@console:~$: inferjs-compiler -f ./test1.js ./test2.js -o ./path/infer-object.js 

InferJS-Compiler: parse-file-list

| Action                   |Cmd| Description | | :-- | :--: | :-- |
| parse-file-list | -l | Parses a delimited file with JavaScript file or directory paths, looking for JSDoc multi-line comments per file. Parses the JSDoc comments into an InferObject, that can be outputed to the terminal or specified output file. Delimiter Defaults: to newline character. |

Example - Parse File List to Terminal Output:

foo@console:~$: inferjs-compiler -l ./path/file-list.txt -o  

Example - Parse File List to Output File:

foo@console:~$: inferjs-compiler -l ./path/file-list.txt -o ./path/infer-object.js

InferJS-Compiler: combine

| Action                   |Cmd| Description | | :-- | :--: | :-- |
| combine | -c | Combines multiple InferObject files together, outputed to the terminal or specified output file. |

Example - Combine Multiple InferObject Files to Terminal Output:

foo@console:~$: inferjs-compiler -f ./path/infer-object1.js ./path/infer-object2.js -o 

Example - Combine Multiple InferObject Files to Output File:

foo@console:~$: inferjs-compiler -f ./path/infer-object1.js ./path/infer-object2.js -o ./path/new-infer-object.js 

InferJS-Compiler: Options

| Option                 | Cmd | Description | | :-- | :--: | :-- | | --help | -h | Displays the help menu. | | --preview | -p | Displays information about the files to be processed, without actually executing process. | | --quiet | -q | Hide all display information from standard output. | | --stat | -s | Displays statistics about total infers parsed from files or directories. | | --version | -v | Displays the version number of the InferJS-Compiler. |

InferJS-Compiler: INPUT-OPTIONS

| Option                                                   | Description | | :-- | :-- | | --input-options-flags | The file input flags for reading file. Flags: (r, r+, rs, rs+, w+, wx+, a+, ax+) | | --input-options-encoding | The encoding type for the input files. Example: UTF8. | | --input-options-recursive | Used in combination with -d, to recursively navigate through sub directories, looking for files to parse. | | --input-options-file-extensions | Used in combination with -d, to allow only specific file extensions to be parsed from directories. | | --input-options-delimiter | Used in combination with -l, to specify the delimiter for parsing the file list with. Defaults to newline character. |

InferJS-Compiler: OUPUT-OPTIONS

| Option                                           | Description | | :-- | :-- | | --output-options-env | The environment variable for the output file. (development, dev, production, prod) Defaults to production. |
| --output-options-flags | The file output flags for writing file. Flags: (r+, rs+, w, wx, w+, wx+, a, ax, a+, ax+) | | --output-options-module | Generates the output InferObject, in a specific module type format. Formats: (esmodule, commonjs, script, json). Defaults to script. |

InferJS-Compiler: NodeJS Read/Write Flags

| Flag     | Description | |:-- | :-- | | r | Open file for reading. An exception occurs if the file does not exist. | | r+ | Open file for reading and writing. An exception occurs if the file does not exist. | | rs | Open file for reading in synchronous mode. | | rs+ | Open file for reading and writing, asking the OS to open it synchronously. See notes for rs about using this with caution. | | w | Open file for writing. The file is created (if it does not exist) or truncated (if it exists). | | wx | Like w but fails if the path exists. | | w+ | Open file for reading and writing. The file is created (if it does not exist) or truncated (if it exists). | | wx+ | Like w+ but fails if path exists. | | a | Open file for appending. The file is created if it does not exist. | | ax | Like a but fails if the path exists. | | a+ | Open file for reading and appending. The file is created if it does not exist. | | ax+ | Like a+ but fails if the the path exists. |

Heading  InferJS-Compiler: Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag enhancement. Don't forget to give the project a ⭐ star, Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Heading  InferJS-Compiler: License

Distributed under the MIT License. See LICENSE.txt for more information.

Heading  InferJS-Compiler: Support Related