
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
[](https://travis-ci.org/AckeeCZ/enmail) [](https://www.npmjs.com/package/enmail) [;
// Mail object providing universal message container used throughout
// all the offices
const mail: Mail = {
from: 'me@gmail.com',
to: 'example@test.org',
type: MailType.HTML, // MailType.TEXT
subject: 'Hello, its me',
content: `<p>I was wondering if after all these years you'd like to meet to go over everything ...</p>`,
// optional: mailerOptions
};
// Gets office by key. Called without parameters, gets the default instance.
getOffice()
.send(mail)
.then(res => /* ... */)
.catch(e => /* ... */)
// ...
Formerly an email sender, generally a message sender. Emails - electronic mails, letters... letters are sent and delivered by a post office, thus office is the key hub for sending those messages.
Office have to be built first. Once built, offce can send a message.
import {
// (templateString, context) Given template string
// (https://lodash.com/docs/4.17.4#template) and variables, function compiles
// this template and can later be used to create a message from that template
//
// context.locale: String (`en`, locale for i18n)
// context.tz: String (`UTC`, timezone)
compileLodashTemplate,
// Same as above only templateString is a filename to that template
compileLodashFileTemplate,
Mail }
from 'enmail';
/*
variables automatically exposed to be used in a template
(aside from directly passed variables to a template and template
compiler as a context)
__: (key: String, ...variables) -> String
Translation function, internally using i18n. Identity fn by default.
dateTimeFormat: (date: Date|String, tz: String) -> String
Date formatter using context.locale
currencyFormat: (n: Number, currency: String) -> String
i18n-formatted currency
[numberFormat]: TBA
*/
const templateString = `
<!DOCTYPE html>
<html>
<body>
<%= __('You can recover you password here') %>
<%= url %>?token=<%= token %>
</body>
</html>
`
const compiled = compileLodashTemplate(templateString, { url: 'http://api', token: '__TOKEN__' })
// <!DOCTYPE html>
// <html>
// <body>
// You can recover you password here
// http://api?token=__TOKEN__
// </body>
// </html>
const mail: Mail = {
// ...
content: compiled(),
// ...
};
npm run build
It runs tsc -p .
npm run test
npm run lint
This project is licensed under MIT.
FAQs
[](https://travis-ci.org/AckeeCZ/enmail) [](https://www.npmjs.com/package/enmail) [
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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.