gulp-pegjs

0.2.0 • Public • Published

gulp-pegjs

Build Status

This gulp plugin will generate a parser based on a pegjs grammar for its input files.

Install

npm install --save-dev gulp-pegjs

Usage

To generate the PEG.js parser you simply need to add these lines to your gulpfile.

var gulp  = require('gulp');
var pegjs = require('gulp-pegjs');
 
gulp.task('default', function() {
    return gulp.src('src/*.pegjs')
        .pipe(pegjs())
        .pipe(gulp.dest('dist'));
});

You can tweak the generated parser by passing an argument to the function call. The options are described in the PEG.js documentation.

var gulp  = require('gulp');
var pegjs = require('gulp-pegjs');
 
gulp.task('default', function() {
    return gulp.src('src/*.pegjs')
        .pipe(pegjs({format: "globals", exportVar: "parser"}))
        .pipe(gulp.dest('dist'));
});

/gulp-pegjs/

    Package Sidebar

    Install

    npm i gulp-pegjs

    Weekly Downloads

    3

    Version

    0.2.0

    License

    ISC

    Unpacked Size

    21.3 kB

    Total Files

    8

    Last publish

    Collaborators

    • jonathanbp