
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
multiline-ts
Advanced tools
Readable multi-line template strings for Javascript or Typescript.
multiline is a template tag function which removes leading indentation from each line of a string, and the first/last newline, to allow it to be more readable in code.
multiline also indents multi-line strings in template variables.
npm install multiline-ts
import multiline from 'multiline-ts';
const string = multiline`
Multiline string
with varying
indentation
`;
Is equivalent to:
const string = `Multiline string
with varying
indentation`;
Which creates the string:
Multiline string
with varying
indentation
import multiline from 'multiline-ts';
const condition1 = true;
const condition2 = true;
if (condition1) {
if (condition2) {
const string = multiline`
Multiline string
with varying
indentation
`;
}
}
Creates the same string:
Multiline string
with varying
indentation
import multiline from 'multiline-ts';
const value = '1\n2\n3';
const string = multiline`
Indented value:
${value}
`;
Creates the string:
Indented value:
1
2
3
Extra newlines are respected:
import multiline from 'multiline-ts';
const string = multiline`
Here is
Another string
For you
`;
Creates the string:
Here is
Another string
For you
If you want to use this with CommonJS imports use the following syntax:
const multiline = require('multiline-ts');
const string = multiline(`
Multiline string
with varying
indentation
`);
You can also call multiline as a normal function, however this will not be able to intelligently indent multi-line template variables.
import multiline from 'multiline-ts';
const string = multiline(`
Multiline string
with varying
indentation
`);
Creates the string:
Multiline string
with varying
indentation
FAQs
Readable multiline template strings
The npm package multiline-ts receives a total of 5,962 weekly downloads. As such, multiline-ts popularity was classified as popular.
We found that multiline-ts 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.