You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

977 B



To use the pegjs command, install PEG.js globally:

$ npm install -g pegjs

To use the JavaScript API, install PEG.js locally:

$ npm install pegjs

If you need both the pegjs command and the JavaScript API, install PEG.js both ways.

If you plan to use the pegjs command only in your package.json, it is suggested you install it locally only, as all locally installed packages that contain command line tools are available to it.


Download the PEG.js library (regular or minified version) or use it directly using UNPKG:

<script src=""></script>


To use the latest features, fixes and changes of PEG.js, install the packaged dev release:

$ npm install pegjs@dev

On the browser you can use UNPKG again:

<script src=""></script>