Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
string-apostrophes
Advanced tools
Readme
Comprehensive, HTML-entities-aware tool to typographically-correct the apostrophes and single/double quotes
This package is pure ESM. If you're not ready yet, install an older version of this program, 1.5.0 (npm i string-apostrophes@1.5.0
).
npm i string-apostrophes
import { strict as assert } from "assert";
import { convertOne, convertAll } from "string-apostrophes";
assert.deepEqual(
convertAll(`In the '60s, rock 'n' roll`, {
convertApostrophes: true,
convertEntities: false,
}),
{
result: "In the ’60s, rock ’n’ roll",
ranges: [
[7, 8, "’"],
[18, 21, "’n’"],
],
}
);
assert.deepEqual(
convertOne(`test's`, {
from: 4,
to: 5,
convertApostrophes: true,
convertEntities: true,
}),
[[4, 5, "’"]]
);
Please visit codsen.com for a full description of the API.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License
Copyright (c) 2010-2022 Roy Revelt and other contributors
FAQs
Comprehensive, HTML-entities-aware tool to typographically-correct the apostrophes and single/double quotes
The npm package string-apostrophes receives a total of 173 weekly downloads. As such, string-apostrophes popularity was classified as not popular.
We found that string-apostrophes demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.