Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@babel/plugin-proposal-json-strings
Advanced tools
Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings
The @babel/plugin-proposal-json-strings package is a plugin for Babel that allows you to use the JSON strings proposal in your JavaScript code. This proposal makes it possible to write escape sequences for line separators (\u2028) and paragraph separators (\u2029) within string literals, which are otherwise not allowed in JSON. This can be useful when dealing with JSON data that may include these characters.
JSON Strings Proposal Support
This feature allows you to include line and paragraph separators in your JSON strings, which are part of the ECMAScript 2019 (ES10) specification. The plugin transforms these literals into valid JavaScript strings.
"This is a JSON string with a line separator: \u2028 and a paragraph separator: \u2029"
This Babel plugin transforms Unicode text into escaped ASCII form, which can be useful for avoiding encoding issues or for representing non-printable characters in a readable format. It is similar to @babel/plugin-proposal-json-strings in that it deals with string encoding, but it is more general in its approach.
JSON5 is a JS library and npm package that allows for the parsing and serialization of a superset of JSON that includes features from ECMAScript 5. It is similar to @babel/plugin-proposal-json-strings in that it allows for a more flexible JSON format, including unquoted keys, single quotes, and trailing commas.
Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings
See our website @babel/plugin-proposal-json-strings for more information.
Using npm:
npm install --save-dev @babel/plugin-proposal-json-strings
or using yarn:
yarn add @babel/plugin-proposal-json-strings --dev
FAQs
Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings
The npm package @babel/plugin-proposal-json-strings receives a total of 5,631,582 weekly downloads. As such, @babel/plugin-proposal-json-strings popularity was classified as popular.
We found that @babel/plugin-proposal-json-strings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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 its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.