LeaVerou/prism — pull request #179 by geraintluff (2013-11-12 22:54:12+00:00)
Title: Add Node.js support

This PR adds support for using Prism in Node.js, without changing browser behaviour. The changes are:

* `self` is declared as a variable (equal to `window` in the browser, or `{}` in Node).
* `Prism` is declared as a variable in `prism-core.js` so that other (bundled) files can use it
* If `module.exports` is defined, then it is assigned to `Prism`.

I believe these should have no effect in a browser environment - `test.html` still works for me, at least.

Node.js usage:

```javascript
var Prism = require('./prism.js');

var jsCode = 'var a = 1';
var html = Prism.highlight(jsCode, Prism.languages.javascript);
console.log(html);
```

It should be ready for you to publish on Npm (`npm publish`).