UNPKG

1.12 kBMarkdownView Raw
1# pogoify
2
3browserify v2 plugin for PogoScript
4
5mix 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
12npm install pogoify
13```
14
15# usage
16
17## command line
18
19```sh
20browserify -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
26You can also mix and match Pogoscript files with other languages supported by browserify.
27
28## express
29
30 npm install browserify-middleware
31
32Then, in app.js:
33
34```js
35var browserify = require('browserify-middleware');
36
37...
38
39app.get('browserapp.js', browserify('./browser/app.js', {transform: ['pogoify'], extensions: ['.pogo']}));
40```
41
42# example files
43
44given some files written in a mix of `js` and `pogo`:
45
46foo.pogo, the _entry_ file:
47```pogo
48console.log(require './bar')
49```
50
51bar.js:
52```js
53module.exports = require('./baz')(5)
54```
55
56baz.pogo:
57```pogo
58module.exports (n) = n * 111
59```
60
61# license
62
63MIT