0.1.1 • Published 10 years ago

package-writer v0.1.1

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

package-writer

Transforms and writes the files for a cartero package. Returns a map of file name to transformed output stream.

Methods

var packageWriter = require('package-writer');

packageWriter(packageJSON, assets, outputDir, callback)

callback's second parameter is a map of file name to output stream for the transformed file contents.

Parameters: packageJSON - The package info for the package being written. Should contain:

  • path - the directory of the package
  • cartero - any transforms that need to be performed on the assets in the package. Valid properties are styleTransform, imageTransform, and templateTransform.

assets - A map of asset type to files. The valid asset types are style, image, and template. outputDir - The directory where the transformed/copied files should be outputted.

Example:

var packageJSON = {
	path : "/path/to/app/package1",
	cartero : {
		styleTransform : [ "sass-transform" ]
	}
};

var assets = {
	style : [ "/path/to/app/package1/styles.sass" ]
};

var outputDir = "/path/to/app/static/package1Output";

var outputStreams = packageWriter( packageJSON, assets, outputDir, function( err, outputStreams ) {} );
0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago