$ npm install snapdragon-is-insideSnapdragon plugin that adds an
isInsidemethod to the compiler instance for checking if a node is currently inside a given node type.
Install with npm:
$ npm install --save snapdragon-is-inside
The main export if a function that should be passed to snapdragon.use() to register the plugin.
Example
var Snapdragon = require('snapdragon');
var isInside = require('snapdragon-is-inside');
// register the plugin
var snapdragon = new Snapdragon();
snapdragon.use(isInside());
// or register directly on the compiler instance
var compiler = new Snapdragon.Compiler();
compiler.use(isInside());
Returns true if node is currently inside the given node type(s).
Params
node {Object}types {String|Array|Regex}: Pass one or more types to check for, or a regex to use for matching types.returns {Boolean}: Returns true if the pluginExample
snapdragon.use(isInside());
snapdragon.compiler
.set('foo', function(node) {
if (this.isInside(node, 'some-other-node-type')) {
// do stuff
}
});
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)
To generate the readme and API documentation with verb:
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2017, Jon Schlinkert. Released under the MIT license.
This file was generated by verb-generate-readme, v0.4.1, on January 21, 2017.