Have ideas to improve npm?Join in the discussion! »

    @postdfm/plugin
    TypeScript icon, indicating that this package has built-in type declarations

    7.0.0 • Public • Published

    @postdfm/plugin

    Sub-package for postdfm.

    Provides structure and utilities for making plugins that can modify the structure provided by @postdfm/ast.

    npm CircleCI branch Codecov branch Known Vulnerabilities

    Table of Contents

    Installation

    # npm
    $ npm install @postdfm/plugin
    
    # yarn
    $ yarn add @postdfm/plugin

    Example Usage

    const { Plugin } = require("@postdfm/plugin");
    
    class SomePlugin extends Plugin {
      install(hooks) {
        hooks.string.tap(ast => {
          // manipulate AST here
        }
    
        // all AST types can be manipulated, see AST.ASTTypes
    
        // also available:
        // - "after" hook for certain types
        hooks.after.object.tap(ast => {
          // manipulate AST here
        })
        // - "all" hook for everything - excludes "after" hooks
        hooks.all.tap(ast => {
          // manipulate AST here
        })
      }
    }

    Documentation

    See postdfm for more information, or the generated typedoc documentation here.

    Contributing

    Bug reports and feature requests are greatly appreciated, as are pull requests.

    Please see the Contributing Guide for instructions on how to contribute to this project.

    License

    Licensed under the MIT License.

    Keywords

    none

    Install

    npm i @postdfm/plugin

    DownloadsWeekly Downloads

    102

    Version

    7.0.0

    License

    MIT

    Unpacked Size

    8.4 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar