Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
literal-toast
Advanced tools
Helper for making template literal tags; combines template literal values so you don't have to
Helper for making template literal tags; combines template literal values so you don't have to
Tagged template literals are a feature of ES6/ES2015 which allows processing of template literals (template strings).
This is a little helper for zipping the literals and substitutions so your tag can operate on or return the final value of the template string without reimplementing this logic itself.
Spread the literals and substitutions from the template literal onto literalToast
;
import literalToast from 'literal-toast';
function lineReverse(literals, ...substitutions) {
return literalToast(literals, ...substitutions)
.split('\n')
.reverse()
.join('\n');
}
lineReverse`but it demonstrates what this does pretty simply.
This is a weird example,`;
// Returns:
// "This is a weird example,
// but it demonstrates what this does pretty simply."
The above example shows both the literals and substitutions for clarity, but if you don't use either parameter yourself, you can write it like this instead;
function myTag(...literalValues) {
return literalToast(...literalValues) // your logic here
}
FAQs
Helper for making template literal tags; combines template literal values so you don't have to
The npm package literal-toast receives a total of 131 weekly downloads. As such, literal-toast popularity was classified as not popular.
We found that literal-toast demonstrated a not healthy version release cadence and project activity because the last version was released 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.