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

strikethrough-js

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strikethrough-js

Manipulate strikethrough chars in Javascript

  • 1.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
Maintainers
1
Weekly downloads
 
Created
Source

StrikethroughJS

Manipulate plain text strikethrough chars in Javascript.

npm version

Why?

Strikethrough is represented by words with a horizontal line through their center. It implies that the text is wrong and was recently deleted or marked as such. Unlike the HTML's tag, strikethrough text will work when you copy-paste it in to another location. That’s because the strikethrough characters [...] are in plain text. - Saijo George

This library allows you to get rid of this because some fonts doesn't support strikethrough. You will be able to apply strikethrough another way (e.g., in CSS: text-decoration: line-through;)

Install

npm i strikethrough-js

Usage

var lib = require('strikethrough-js');
var res = lib.removeStrikethrough('...');
import {
    removeStrikethrough
} from 'strikethrough-js';
var res = removeStrikethrough('...');

Remove strikethrough

var str = removeStrikethrough('1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
// 123789€

Remove strikethrough chars

var str = removeStrikethroughChars('456€ 1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
// 456€ 

Get strikethrough chars

var str = getStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// ["1̶", "2̶", "3̶", "7̶", "8̶", "9̶", "€̶"]

Get strikethrough string

var str = getStrikethroughString('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// 1̶2̶3̶7̶8̶9̶€̶

Get chars

var str = getChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// ["1", "2", "3", "7", "8", "9", "€"]

Get string

var str = getString('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
// 123789€

Testing

npm t

Will use Jest test suites and pre-commit hook.

Keywords

FAQs

Package last updated on 30 Nov 2018

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