@njudah/builder
Build tool
Last updated 3 years ago by njudah .
MIT · Original npm · Tarball · package.json
$ cnpm install @njudah/builder 
SYNC missed versions from official npm registry.

N Judah Builder

This is a build tool for applying transforms to files.

How Do I use It?

You specify your build using (generic) JSX:

const { build, transform } = require("@njudah/builder");
const babel = require("@njudah/builder/transform/babel");

<build  path = "/path/to/your/project"
        destination = "/path/to/build/folder"
        ignore = "**/node_modules" >
    <transform match = "**/*.js" >
        <babel options = { { presets: ["es2015-node4", "stage-0"] } } />
    </transform>
</build>

Use the promisified interface to run the build and grab the final location:


require("@njudah/builder/promisifed")(
    <build  path = "/path/to/your/project"
        destination = "/path/to/build/folder"
        ignore = "**/node_modules" >
        <transform match = "**/*.js" >
            <babel options = { { presets: ["es2015-node4", "stage-0"] } } />
        </transform>
    </build>
)
    .then(function (x)
    {
        console.log(x);
    });

If you do not have access to generic JSX, you can use the alternative array syntax:


require("@njudah/builder/promisifed")(
    [build,
    {
        path: "/path/to/your/project",
        destination: "/path/to/build/folder"
        ignore: "**/node_modules"
    },
        [transform, { match: "**/*.js" },
            [babel, { options: { presets: ["es2015-node4", "stage-0"] } }
        ]
    ]
)
    .then(function (x)
    {
        console.log(x);
    });

build attributes

  • path: source path
  • destination: destination folder
  • ignore: files to ignore. Can be glob string, or array of glob strings.

transform attributes

  • match - files to match. Can be glob string, or array of glob strings.

transform child

Transform expects one child, the actual transform function to run. babel is the only currently supported one.

babel attributes

  • options - Babel options.

Current Tags

  • 12.0.0-beta.4                                ...           latest (3 years ago)

14 Versions

  • 12.0.0-beta.4                                ...           3 years ago
  • 12.0.0-beta.3                                ...           3 years ago
  • 12.0.0-beta.2                                ...           3 years ago
  • 12.0.0-beta                                ...           3 years ago
  • 11.0.0                                ...           3 years ago
  • 10.0.0                                ...           3 years ago
  • 9.0.0                                ...           3 years ago
  • 8.0.0                                ...           3 years ago
  • 7.0.0                                ...           3 years ago
  • 6.0.0                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 2
This Month 1
Last Day 0
Last Week 2
Last Month 12
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |