1 | # pogoify
|
2 |
|
3 | browserify v2 plugin for PogoScript
|
4 |
|
5 | mix and match `.pogo` and `.js` files in the same project
|
6 |
|
7 | [![build status](https://secure.travis-ci.org/featurist/pogoify.png)](http://travis-ci.org/featurist/pogoify)
|
8 |
|
9 | # install
|
10 |
|
11 | ```sh
|
12 | npm install pogoify
|
13 | ```
|
14 |
|
15 | # usage
|
16 |
|
17 | ## command line
|
18 |
|
19 | ```sh
|
20 | browserify -t pogoify --extension .pogo app.pogo > app.js
|
21 | ```
|
22 |
|
23 | `-t pogoify` tells browserify to compile any `.pogo` file it finds.
|
24 | `--extension .pogo` tells browserify to consider files with the `.pogo` extension.
|
25 |
|
26 | You can also mix and match Pogoscript files with other languages supported by browserify.
|
27 |
|
28 | ## express
|
29 |
|
30 | npm install browserify-middleware
|
31 |
|
32 | Then, in app.js:
|
33 |
|
34 | ```js
|
35 | var browserify = require('browserify-middleware');
|
36 |
|
37 | ...
|
38 |
|
39 | app.get('browserapp.js', browserify('./browser/app.js', {transform: ['pogoify'], extensions: ['.pogo']}));
|
40 | ```
|
41 |
|
42 | # example files
|
43 |
|
44 | given some files written in a mix of `js` and `pogo`:
|
45 |
|
46 | foo.pogo, the _entry_ file:
|
47 | ```pogo
|
48 | console.log(require './bar')
|
49 | ```
|
50 |
|
51 | bar.js:
|
52 | ```js
|
53 | module.exports = require('./baz')(5)
|
54 | ```
|
55 |
|
56 | baz.pogo:
|
57 | ```pogo
|
58 | module.exports (n) = n * 111
|
59 | ```
|
60 |
|
61 | # license
|
62 |
|
63 | MIT
|