0.1.4 • Published 10 years ago

rind-modules v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Rind Modules npm.io

Build a symlink tree to turn a module-based file hierarchy into an entity based one

├── modules  // input directory
│   ├── aaa
│   │   └── bbb.mod
│   │       ├── assets
│   │       │   └── img
│   │       │       └── file.txt
│   │       ├── lib
│   │       │   └── file.txt
│   │       └── templates
│   │           └── file.txt
│   └── ccc.mod
│       ├── assets
│       │   └── img
│       │       └── file.txt
│       └── templates
│           └── file.txt
└── output  // output directory
    ├── assets
    │   └── img  // mapped a sub-directory
    │       ├── aaa
    │       │   └── bbb -> ../../../../modules/aaa/bbb.mod/assets/img
    │       └── ccc -> ../../../modules/ccc.mod/assets/img
    ├── lib
    │   └── aaa
    │       └── bbb -> ../../../modules/aaa/bbb.mod/lib
    └── templates
        ├── aaa
        │   └── bbb -> ../../../modules/aaa/bbb.mod/templates
        └── ccc -> ../../modules/ccc.mod/templates

Modules are identified by having a .mod extension on their directory. Modules cannot be nested inside eachother, but can be nested inside a directory tree to allow grouping of related modules. For example:

modules/
  user/
    login.mod ...
    signup.mod ...

Usage

var rindModules = require('rind-modules');

// object describing module top-level directories to map
var anatomy = {
  lib: true,        // map the `lib` directory
  templates: true,  // map the `templates` directory
  assets: {         // map the `assets` directory and
    sub: true       // its `sub`directories
  }
}

rindModules({
  anatomy: anatomy,
  input: __dirname,
  output: __dirname + '/output',
  // rm: true, // use with caution - deletes any existing targets in the output directory
  verbose: true,
});
0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago