Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@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
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.