node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



Build Status Build status codecov dependencies Status devDependencies Status

A compiler for web contents.


$ npm install --save-dev uicompile


Write your configuration to a file.

const {
const replacer = new NameReplacer();
module.exports = {
  base: 'src',
  dest: 'dest',
  pipelines: [
      src: 'src/**/*.html',
      pipeline: [
      src: 'src/**/*.@(js|css)',
      pipeline: [

Then run the command.

uicompie --config path/to/config.js


  • config.base: String. It is used to get relative path.
  • config.dest: String|fn(File) → String. A file path to where the result will be written.
  • config.pipelines: Array..

Interface: entry

  • entry.src: String|[String, Object]. It is passed to glob.
  • entry.pipeline: Array.. The first stream receives instances of File.

class: File

  • File.prototype.path: String (readonly). The absolute path to the source.
  • File.prototype.cwd: String (readonly). The current working directory.
  • File.prototype.dest: String. The absolute path to where the file will be written.
  • File.prototype.basename: String. get/set the basename of dest.
  • File.prototype.dirname: String. get/set the dirname of dest.
  • File.prototype.extname: String. get/set the extname of dest.
  • File.prototype.stem: String. get/set the basename (without extname) of dest.
  • File.prototype.history: Array.. The history of dest. history[0] is path.