Permalink
Browse files

Add component.json

  • Loading branch information...
mathiasbynens committed Jun 6, 2013
1 parent 3f07743 commit 263419245b1252a9fe04fcbbcb3987f227ebb9fe
Showing with 51 additions and 19 deletions.
  1. +1 −0 .npmignore
  2. +28 −16 README.md
  3. +4 −3 bower.json
  4. +18 −0 component.json
@@ -3,4 +3,5 @@
coverage
tests
bower.json
component.json
Gruntfile.js
@@ -10,33 +10,45 @@ Feel free to fork if you see possible improvements!

## Installation and usage

In a browser:

~~~html
<script src="luamin.js"></script>
~~~

Via [npm](http://npmjs.org/):

~~~bash
```bash
npm install luamin
~~~
```

Via [Bower](http://bower.io/):

```bash
bower install luamin
```

Via [Component](https://github.com/component/component):

```bash
component install mathiasbynens/luamin
```

In a browser:

```html
<script src="luamin.js"></script>
```

In [Narwhal](http://narwhaljs.org/), [Node.js](http://nodejs.org/), and [RingoJS](http://ringojs.org/):

~~~js
```js
var luamin = require('luamin');
~~~
```

In [Rhino](http://www.mozilla.org/rhino/):

~~~js
```js
load('luamin.js');
~~~
```

Using an AMD loader like [RequireJS](http://requirejs.org/):

~~~js
```js
require(
{
'paths': {
@@ -48,18 +60,18 @@ require(
console.log(luamin);
}
);
~~~
```

Usage example:

~~~js
```js
var luaCode = 'a = ((1 + 2) - 3) * (4 / (5 ^ 6)) -- foo';
luamin.minify(luaCode); // 'a=(1+2-3)*4/5^6'
// `minify` also accepts luaparse-compatible ASTs as its argument:
var ast = luaparse.parse(luaCode, { 'scope': true });
luamin.minify(ast); // 'a=(1+2-3)*4/5^6'
~~~
```

### Using the `luamin` binary

@@ -3,16 +3,17 @@
"version": "0.2.6",
"main": "luamin.js",
"dependencies": {
"luaparse": "~0.0.11"
"luaparse": "~0.0.14"
},
"ignore": [
"bin",
"coverage",
"man",
"tests",
".*",
"component.json",
"Gruntfile.js",
"package.json",
"node_modules"
"node_modules",
"package.json"
]
}
@@ -0,0 +1,18 @@
{
"name": "luamin",
"version": "0.2.6",
"description": "A Lua minifier written in JavaScript",
"repo": "mathiasbynens/luamin",
"license": "MIT/GPL",
"scripts": [
"luamin.js"
],
"dependencies": {
"oxyc/luaparse": "0.0.14"
},
"keywords": [
"lua",
"minify",
"minifier"
]
}

0 comments on commit 2634192

Please sign in to comment.