Permalink
Browse files

docs and package.json

  • Loading branch information...
substack committed Jun 14, 2012
1 parent 0854e16 commit 96039f0f5c3aa37a8d8b34417aeb2e12e68fd453
Showing with 149 additions and 0 deletions.
  1. +106 −0 README.markdown
  2. +1 −0 example/files/a.txt
  3. +1 −0 example/files/b.txt
  4. +41 −0 package.json
View
@@ -0,0 +1,106 @@
+exportify
+=========
+
+Generate require()-able javascript files from non-javascript files.
+
+example
+=======
+
+command-line usage
+------------------
+
+```
+$ for f in files/*.txt; do echo $f:; cat <(echo -n ' ') $f; done
+files/a.txt:
+ beep
+files/b.txt:
+ boop
+```
+
+```
+$ ../bin/cmd.js -v files/*.txt
+files/a.txt
+files/b.txt
+```
+
+```
+$ for f in files/*.js; do echo $f:; cat <(echo -n ' ') $f; done
+files/a.txt.js:
+ module.exports="beep\n"
+files/b.txt.js:
+ module.exports="boop\n"
+```
+
+api
+---
+
+``` js
+var exportify = require('exportify');
+var ex = exportify([ 'a.txt', 'b.txt' ]);
+
+ex.on('export', function (file) {
+ console.log('exported ' + file);
+});
+
+ex.on('end', function () {
+ console.log('all done');
+});
+```
+
+***
+
+```
+$ node ex.js
+exported files/a.txt
+exported files/b.txt
+all done
+```
+
+usage
+=====
+
+```
+Usage: exportify OPTIONS [files]
+
+ OPTIONS:
+ -h, --help show this message
+ -e, --ext only exportify files with this extension
+ -v, --verbose log a message for every file written
+
+```
+
+methods
+=======
+
+``` js
+var exportify = require('exportify')
+```
+
+exportify(files, opts={})
+------------------------
+
+For each file in the `files` array,
+generate a `file + '.js'` file that exports the file's contents.
+
+Optionally, if `opts.ext` is set, only include files in the `files` list with
+the `opts.ext` extension.
+
+install
+=======
+
+With [npm](http://npmjs.org), to get the command-line tool do:
+
+```
+npm install -g exportify
+```
+
+and to install the library do:
+
+```
+npm install exportify
+```
+
+license
+=======
+
+MIT
View
@@ -0,0 +1 @@
+beep
View
@@ -0,0 +1 @@
+boop
View
@@ -0,0 +1,41 @@
+{
+ "name" : "exportify",
+ "version" : "0.0.0",
+ "description" : "generate require()-able javascript files from non-javascript files",
+ "main" : "index.js",
+ "bin" : {
+ "exportify": "bin/cmd.js"
+ },
+ "directories" : {
+ "example" : "example",
+ "test" : "test"
+ },
+ "dependencies" : {
+ "optimist" : "~0.3.4"
+ },
+ "devDependencies" : {
+ "tap" : "~0.2.5"
+ },
+ "scripts" : {
+ "test" : "tap test/*.js"
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "git://github.com/substack/exportify.git"
+ },
+ "homepage" : "https://github.com/substack/exportify",
+ "keywords" : [
+ "exports",
+ "module",
+ "commonjs",
+ "file",
+ "browserify"
+ ],
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ },
+ "license" : "MIT",
+ "engine" : { "node" : ">=0.6" }
+}

0 comments on commit 96039f0

Please sign in to comment.