🚀 Launch Week Day 2:Introducing Custom Tabs for Org Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

extract-snippet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-snippet

Extract a snippet of code from a string.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

extract-snippet NPM version

Extract a snippet of code from a string.

Install

Install with npm

$ npm i extract-snippet --save

Usage

var extract = require('extract-snippet');

extract a snippet

var a = 'a <!-- snippet -->\nfoo\n<!-- endsnippet --> b';
extract(a);
//=> 'foo'

var b = 'a <!-- snippet -->a b c<!-- endsnippet --> b';
extract(b);
//=> 'a b c'

custom delimiters

var str = 'a {{snippet}}\nfoo\n{{endsnippet}} b';
extract(str, {delimiters: ['{{', '}}']});
//=> 'foo'
  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more
  • inject-snippet: Inject a snippet of code or content into a string.
  • snippet: CLI and API for easily creating, reusing, sharing and generating snippets of code from the… more
  • scaffold: Generate a project or files from scaffolds.
  • verb: Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.

This file was generated by verb-cli on August 17, 2015.

Keywords

add

FAQs

Package last updated on 17 Aug 2015

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