Nacho Portmanteau Meltdown

    linemod

    0.3.0 • Public • Published

    Linemod

    js-semistandard-style

    CLI companion for linemod-core, a comment driven line modification tool.

    Usage

    As npm script

    yarn add --dev linemod
    "scripts": {
      "test": "linemod -e new index.js lib/utils.js"
    }

    Command line

    npm install -g linemod

    Then run it at on your files that has modifications:

    linemod -e new index.js lib/utils.js

    If your command line supports globbing, then you can do:

    linemod -e new *.js lib/**/*.js

    Programmatic use

    Use linemod-core directly.

    Flags

    • --extension / -erequired – the file extension used on the output files.

    Additional command line flags

    • --help / -h – prints all available flags
    • --strict / -s – treats warnings as errors
    • --verbose / -v – prints warnings and notices

    Available modifications

    All linemod-core modifications are supported. Linemods are added at the end of the line they are supposed to apply to.

    linemod-prefix-with:

    Prefixes the line with whatever is specified after the keyword:

    const exportedMethod = () => {}; // esm-prefix-with: export

    Becomes:

    export const exportedMethod = () => {};

    linemod-replace-with:

    Replaces the line with whatever is specified after the keyword:

    const escape = require('stringify-entities'); // esm-replace-with: import escape from 'stringify-entities';

    Becomes:

    import escape from 'stringify-entities';

    linemod-remove

    Simply removes the entire line.

    Quite useful when combined with linemod-prefix-with:

    const exportedMethod = () => {}; // esm-prefix-with: export
    module.exports = { exportedMethod }; // esm-remove

    Becomes:

    export const exportedMethod = () => {};

    Keywords

    none

    Install

    npm i linemod

    DownloadsWeekly Downloads

    43

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    6.78 kB

    Total Files

    4

    Last publish

    Collaborators

    • voxpelli