New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mr-doc-compiler

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mr-doc-compiler

The official compiler for Mr. Doc

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Compiler

Build Status

This repo contains the source file for compiler. There are a few things to cover in order to understand how the compiler works.

Specification

The compiler in index.js, uses the Factory Pattern to create different compilers for the specified format.

There are three main formats that the compiler will output:

  • HTML (including themes)
  • JSON
  • Markdown

However, the compiler should not write any files to a path. It should only produce a string that is ready to be piped down a stream.

Interface

Initially the interface was written in TypeScript, but to keep things simple for those who are not familiar with TypeScript and would like to contribute, I decided to stick with ES6 (without Babel).

The following would be interface that must be implemented (unless specified):

class ICompiler {
  /**
   * ICompiler
   * @param  {Object} options - The options for the compiler provided by mr-doc-utils/options
   */
  constructor(options) {
    this.options = options;
  }
  /**
   * Compiles the parsed comments into the desired output.
   * @param  {Array<Object>} results The parsed comments.
   * @return {*}         The compiled output.
   */
  compile(results) {
    // ...
  }
}

FAQs

Package last updated on 17 May 2016

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