Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

highlight-fragment.js

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

highlight-fragment.js

returns the sequence with highlighted fragment if the pattern matches, else just the sequence

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

highlight-fragment.js (written in ES6)

license npm build code climate devDependencies js-standard-style

Install:

npm install highlight-fragment.js

Run tests

npm test

highlightFragment()

returns the sequence with highlighted fragment if the pattern matches, else just the sequence.

import highlightFragment from 'highlight-fragment.js';

// result: 'm<strong>e - an</strong>dmax'
highlightFragment('me - andmax', 'ean', '[- ]*', 'strong');

// result: '0<strong>163</strong> - 3094512'
highlightFragment('0163 - 3094512', '163', '[- ]*', 'strong')

Copyright © 2015 Maximilian Heinz, contributors. Released under the MIT License

Keywords

FAQs

Package last updated on 06 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc