🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

snapdragon-is-inside

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snapdragon-is-inside

Snapdragon plugin that adds an `isInside` method to the compiler instance for checking if a node is currently inside a given node type.

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

snapdragon-is-inside NPM version NPM monthly downloads NPM total downloads Linux Build Status

Snapdragon plugin that adds an isInside method to the compiler instance for checking if a node is currently inside a given node type.

Install

Install with npm:

$ npm install --save snapdragon-is-inside

Usage

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());

.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 plugin

Example

snapdragon.use(isInside());
snapdragon.compiler
  .set('foo', function(node) {
    if (this.isInside(node, 'some-other-node-type')) {
      // do stuff
    }
  });

About

Contributing

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.

Building docs

(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

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT license.

This file was generated by verb-generate-readme, v0.4.1, on January 21, 2017.

Keywords

generategenerator

FAQs

Package last updated on 21 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts