Wondering what’s next for npm?Check out our public roadmap! »

    This package has been deprecated

    Author message:

    jade-walk will be unpublished soon, please use pug-walk

    jade-walk

    0.0.3 • Public • Published

    jade-walk

    Walk and transform a jade AST

    Build Status Dependency Status NPM version

    Installation

    npm install jade-walk
    

    Usage

    var lex = require('jade-lexer');
    var parse = require('jade-parser');
    var walk = require('jade-walk');
     
    var ast = walk(parse(lex('.my-class foo')), function before(node, replace) {
      // called before walking the children of `node`
      // to replace the node, call `replace(newNode)`
      // return `false` to skip descending
      if (node.type === 'Text') {
        replace({ type: 'Text', val: 'bar', line: node.line });
      }
    }, function after(node, replace) {
      // called after walking the children of `node`
      // to replace the node, call `replace(newNode)`
    }, {includeDependencies: true});
    assert.deepEqual(parse(lex('.my-class bar')), ast);

    License

    MIT

    Keywords

    Install

    npm i jade-walk

    DownloadsWeekly Downloads

    12

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar