
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
strikethrough-js
Advanced tools
Manipulate plain text strikethrough chars in Javascript
This library aims to help you manipulate strikethrough characters in strings.
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
It can be useful when some fonts don't support strikethrough text. Using this, you will be able to use regular text and then apply strikethrough another way (e.g., in CSS: text-decoration: line-through;
).
npm install strikethrough-js
// Common
var strikethrough = require('strikethrough-js');
var res = strikethrough.removeStrikethrough('m̶y̶T̶e̶x̶t̶');
// ES5/6
import { removeStrikethrough } from 'strikethrough-js';
const res = removeStrikethrough('m̶y̶T̶e̶x̶t̶');
removeStrikethrough
Returns an equivalent string
of regular text:
const str = removeStrikethrough('Price was 1̶2̶3̶7̶8̶9̶€̶');
// Price was 123789€
removeStrikethroughChars
Returns a string
without strikethrough text:
const str = removeStrikethroughChars('456€ 1̶2̶3̶7̶8̶9̶€̶');
// 456€
getStrikethroughChars
Returns a string[]
of the strikethrough characters:
const str = getStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
// ["1̶", "2̶", "3̶", "7̶", "8̶", "9̶", "€̶"]
getStrikethroughString
Returns a string
of the strikethrough text:
const str = getStrikethroughString('456€ (1̶2̶3̶7̶8̶9̶€̶)');
// 1̶2̶3̶7̶8̶9̶€̶
getChars
Returns an equivalent string[]
of the strikethrough characters:
const str = getChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
// ["1", "2", "3", "7", "8", "9", "€"]
getString
Returns an equivalent string
of the strikethrough characters:
const str = getString('456€ (1̶2̶3̶7̶8̶9̶€̶)');
// 123789€
Since this lib
is pretty light, there is no need for a sophisticated bundler (like Webpack or Rollup). The core lib
is bundled with bare-bones NodeJS and Babel.
npm test
Will run Jest test suites. It will be also triggered by Husky git hooks.
FAQs
Manipulate strikethrough characters in Javascript
The npm package strikethrough-js receives a total of 6 weekly downloads. As such, strikethrough-js popularity was classified as not popular.
We found that strikethrough-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.