Comparing version 0.0.1 to 0.0.2
@@ -17,3 +17,3 @@ #!/usr/local/bin/node | ||
var printUsage = function() { | ||
parser.banner = "Usage: import input_file [output_file] [options]" | ||
parser.banner = "Usage: jspackage input_file [output_file] [options]" | ||
console.log(parser.toString()); | ||
@@ -20,0 +20,0 @@ console.log('\nIf an output file is not provided, a server will be started at'); |
{ | ||
"name": "jspackage", | ||
"description": "build tool which adds client-side import syntax", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Andrew Kelley", |
@@ -31,3 +31,3 @@ Client side build tool with dependency management | ||
included out of the box. You can add more to the `compile.extensions` object. | ||
- Or add support to the bottom of src/jspackage.coffee and submit a pull | ||
- Or add support to the bottom of `src/jspackage.coffee` and submit a pull | ||
request. | ||
@@ -40,2 +40,3 @@ | ||
``` | ||
Usage: jspackage input_file [output_file] [options] | ||
@@ -50,2 +51,3 @@ | ||
the port provided by the --port or -p option or 8080 by default. | ||
``` | ||
@@ -55,15 +57,15 @@ ## Server example | ||
```coffee | ||
http = require 'http' | ||
{compile} = require 'jspackage' | ||
http = require 'http' | ||
{compile} = require 'jspackage' | ||
server = http.createServer (req, res) -> | ||
res.writeHead(200) | ||
compile 'mainfile', (err, code) -> | ||
if err | ||
res.end 'throw unescape("' + escape(err.toString()) + '");' | ||
else | ||
res.end code | ||
server.listen(8080) | ||
server = http.createServer (req, res) -> | ||
res.writeHead(200) | ||
compile 'mainfile', (err, code) -> | ||
if err | ||
res.end 'throw unescape("' + escape(err.toString()) + '");' | ||
else | ||
res.end code | ||
server.listen(8080) | ||
``` | ||
@@ -79,3 +81,3 @@ | ||
To add out-of-the-box support for another language, add it to the bottom of | ||
src/jspackage.coffee and submit a pull request. | ||
`src/jspackage.coffee` and submit a pull request. | ||
@@ -86,6 +88,6 @@ To add support by wrapping the code, add an entry to the `extensions` | ||
```coffee | ||
{extensions} = require 'jspackage' | ||
extensions['.lua'] = | ||
compile: (code) -> lua.compile(code) | ||
import_re: /^--import (".+")$/gm | ||
{extensions} = require 'jspackage' | ||
extensions['.lua'] = | ||
compile: (code) -> lua.compile(code) | ||
import_re: /^--import (".+")$/gm | ||
``` | ||
@@ -92,0 +94,0 @@ |
102
24360