strikethrough-js
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "strikethrough-js", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Manipulate strikethrough chars in Javascript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -11,23 +11,30 @@ <div align="center"> | ||
## Why? | ||
This library aims to help you **manipulate strikethrough characters** in strings. | ||
### What is strikethrough text? | ||
> 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](https://saijogeorge.com/strikethrough-text-generator/) | ||
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;`) | ||
### An example | ||
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;`). | ||
## Install | ||
## Get started | ||
### Install | ||
```sh | ||
npm i strikethrough-js | ||
npm install strikethrough-js | ||
``` | ||
## Usage | ||
### Use | ||
```javascript | ||
// Javascript | ||
// Common | ||
var lib = require('strikethrough-js'); | ||
var res = lib.removeStrikethrough('...'); | ||
var res = lib.removeStrikethrough('m̶y̶T̶e̶x̶t̶'); | ||
// ES5-6 | ||
// ES5/6 | ||
import * as lib from 'strikethrough-js'; | ||
const res = lib.removeStrikethrough('...'); | ||
const res = lib.removeStrikethrough('m̶y̶T̶e̶x̶t̶'); | ||
``` | ||
### Remove strikethrough | ||
## Utils | ||
### `removeStrikethrough` | ||
Remove the strikethrough characters from your string and replace them by regular ones: | ||
```javascript | ||
@@ -39,3 +46,4 @@ const str = removeStrikethrough('1̶2̶3̶7̶8̶9̶€̶'); | ||
### Remove strikethrough chars | ||
### `removeStrikethroughChars` | ||
Remove the strikethrough characters from your string: | ||
```javascript | ||
@@ -47,3 +55,4 @@ const str = removeStrikethroughChars('456€ 1̶2̶3̶7̶8̶9̶€̶'); | ||
### Get strikethrough chars | ||
### `getStrikethroughChars` | ||
Get a list of the strikethrough characters in your string: | ||
```javascript | ||
@@ -55,3 +64,4 @@ const str = getStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)'); | ||
### Get strikethrough string | ||
### `getStrikethroughString` | ||
Get the strikethrough characters in your string: | ||
```javascript | ||
@@ -63,3 +73,4 @@ const str = getStrikethroughString('456€ (1̶2̶3̶7̶8̶9̶€̶)'); | ||
### Get chars | ||
### `getChars` | ||
Get a list of the strikethrough characters of your string, but regular ones: | ||
```javascript | ||
@@ -71,3 +82,4 @@ const str = getChars('456€ (1̶2̶3̶7̶8̶9̶€̶)'); | ||
### Get string | ||
### `getChars` | ||
Get the strikethrough characters of your string, but regular ones: | ||
```javascript | ||
@@ -79,3 +91,3 @@ const str = getString('456€ (1̶2̶3̶7̶8̶9̶€̶)'); | ||
## Develop | ||
## Contribute | ||
### Library | ||
@@ -88,2 +100,2 @@ 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](https://nodejs.org/en/) and [Babel](https://babeljs.io/). | ||
``` | ||
Will use [Jest](https://jestjs.io/) test suites and [pre-commit](https://pre-commit.com/) hook. | ||
Will run [Jest](https://jestjs.io/) test suites. It will be also triggered by [Husky](https://github.com/typicode/husky) git hooks. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15593
14
94