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

strip-combining-marks

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-combining-marks

Easily remove Unicode combining marks from strings.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
59K
decreased by-2.81%
Maintainers
1
Weekly downloads
 
Created
Source

strip-combining-marks Build status Dependency status

strip-combining-marks removes Unicode combining marks from strings. It leaves unmatched combining marks (i.e. marks that appear at the start of the string, and don’t belong to a symbol) intact.

Installation

Via npm:

npm install strip-combining-marks

Via Bower:

bower install strip-combining-marks

Via Component:

component install mathiasbynens/strip-combining-marks

In a browser:

<script src="strip-combining-marks.js"></script>

In Node.js, io.js, Narwhal, and RingoJS:

var stripCombiningMarks = require('strip-combining-marks');

In Rhino:

load('strip-combining-marks.js');

Using an AMD loader like RequireJS:

require(
  {
    'paths': {
      'strip-combining-marks': 'path/to/strip-combining-marks'
    }
  },
  ['strip-combining-marks'],
  function(stripCombiningMarks) {
    console.log(stripCombiningMarks);
  }
);

API

stripCombiningMarks.version

A string representing the semantic version number.

stripCombiningMarks.reverse(string)

This function takes a string and returns the stripped version of that string, where any combining marks that were applied to other symbols have been removed.

Usage example
stripCombiningMarks('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞');
'ZALGO!'

Support

strip-combining-marks has been tested in Chrome 27, Firefox 3, Safari 4, Opera 10, IE 6, Node.js v0.10.0, io.js v1.0.0, Narwhal 0.3.2, RingoJS 0.8, PhantomJS 1.9.1, and Rhino 1.7RC4.

Unit tests & code coverage

After cloning this repository, run npm install to install the dependencies needed for strip-combining-marks development and testing. You may want to install Istanbul globally using npm install istanbul -g.

Once that’s done, you can run the unit tests in Node using npm test or node tests/tests.js. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use grunt test.

To generate the code coverage report, use grunt cover.

Author

twitter/mathias
Mathias Bynens

License

strip-combining-marks is available under the MIT license.

Keywords

FAQs

Package last updated on 15 Mar 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

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