Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@babel/plugin-syntax-nullish-coalescing-operator
Advanced tools
Allow parsing of the nullish-coalescing operator
The @babel/plugin-syntax-nullish-coalescing-operator package allows Babel to parse code that uses the nullish coalescing operator (??). This operator is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined, and otherwise returns its left-hand side operand. This package does not transform the nullish coalescing syntax; it only enables Babel to understand it.
Parsing nullish coalescing operator
This code demonstrates how the nullish coalescing operator is used to provide a default value ('default string') in case the left-hand operand (foo) is null or undefined.
const foo = null ?? 'default string';
This package not only allows Babel to parse the nullish coalescing operator but also transforms it. This means it can convert code using the nullish coalescing operator into equivalent code that does not use the operator, allowing it to run in environments that do not support the operator natively. It offers a superset of the functionality provided by @babel/plugin-syntax-nullish-coalescing-operator.
While not exclusively focused on the nullish coalescing operator, @babel/preset-env includes support for it among many other JavaScript features. This preset automatically determines the Babel plugins and polyfills needed based on the target environment's support for JavaScript features. It's a more comprehensive solution for writing modern JavaScript that is compatible with older environments.
Allow parsing of the nullish-coalescing operator
See our website @babel/plugin-syntax-nullish-coalescing-operator for more information.
Using npm:
npm install --save-dev @babel/plugin-syntax-nullish-coalescing-operator
or using yarn:
yarn add @babel/plugin-syntax-nullish-coalescing-operator --dev
FAQs
Allow parsing of the nullish-coalescing operator
The npm package @babel/plugin-syntax-nullish-coalescing-operator receives a total of 21,353,095 weekly downloads. As such, @babel/plugin-syntax-nullish-coalescing-operator popularity was classified as popular.
We found that @babel/plugin-syntax-nullish-coalescing-operator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.