0.0.2 • Published 8 years ago

copia v0.0.2

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

copia

Node.js library to copy assets located on the node_modules directory to the destination defined in the index.html.

copia on Travis

Quick Start

Download the latest version

npm install --save-dev copia

Require copia:

var cp = require('copia');

Define the location of your node_modules folder and the index.html file:

var config = {"index-html": "./src/index.html", "node-modules": "./node_modules"};

Invoke copia with the config object defined above:

cp.copia(config);

Copia will walk the node_modules directory structure and automatically copy all the assets (css and js) defined in your index.html:

The following reference on index.html...

<link rel="stylesheet" href="public/css/codemirror.css">

... will be copied from node_modules to the actual location referenced above:

public
    css
        codemirror.css 

Same for any script file:

<script src="public/js/codemirror.js"></script>
public
    js
        codemirror.js

Todo

  • Ignore resolving list of files (e.g. var config = {... "ignore":["app.css", "app.js"]};)
  • Create dirs if they don't exist