
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

nano-mail — це модуль для відправки електронних листів за допомогою Nodemailer, зручного для Node.js з використанням nano-format.
Цей пакет дозволяє створювати, форматувати та відправляти електронні листи з вкладеннями, а також визначати одержувачів через поля to, cc та bcc. Він підтримує шаблонізацію HTML-листів та заміну плейсхолдерів у листах, а також відправлення листів за допомогою Nodemailer.
npm install nano-mail
import { Address, Attachment, Email, Target, mailer, mail } from 'nano-mail';
// Створення одержувачів
const target = Target.from({
to: 'ivan@example.com',
cc: 'petr@example.com',
bcc: 'admin@example.com'
});
// Створення листа
const email = new Email({
subject: 'Ваш рахунок',
html: '<h1>Дякуємо за вашу покупку!</h1>',
from: 'Магазин <info@shop.com>',
target: target
});
// Додавання вкладення
const attachment = new Attachment({
filename: 'invoice.pdf',
path: '/path/to/invoice.pdf'
});
email.attach(attachment);
// Налаштування транспорту для Nodemailer
const transportConfig = {
host: 'smtp.example.com',
port: 587,
secure: false, // true для 465, false для інших портів
auth: {
user: 'username',
pass: 'password'
}
};
// Відправка листа
const data = {
name: 'Іван',
purchase: 'товар 123'
};
mail(email, data, { mailer: mailer(transportConfig) })
.then(info => {
console.log('Лист відправлено:', info);
})
.catch(err => {
console.error('Помилка під час відправлення листа:', err);
});
Address представляє електронну адресу.
new Address(name: string, address: string)toString(): Повертає адресу у форматі "Name ".toObject(): Повертає об'єкт з полями name та address.static from(source: string | object): Address | null: Створює екземпляр з рядка або об'єкта.Attachment представляє вкладення до листа.
new Attachment(opts: object)formatForNodemailer(): Форматує вкладення для Nodemailer.Email представляє електронний лист.
new Email(opts: object)attach(attachment: Attachment): Додає вкладення до листа.formatForNodemailer(): Форматує лист для Nodemailer.Target представляє одержувачів листа.
new Target()add(type: 'to' | 'cc' | 'bcc', address: string | Address | string[] | Address[]): Додає адресу до відповідного поля.formatForNodemailer(): Форматує одержувачів для Nodemailer.static from(source: string | object): Target | null: Створює екземпляр з рядка або об'єкта.mailer створює поштовий транспорт для Nodemailer.
mailer(transportConfig: object): objectmail відповідає за відправку листа.
mail(email: Email, data: object, opts?: object): Promise<object | boolean>Цей проект ліцензований за умовами ліцензії ISC.
FAQs
Mailing with the nodemailer and nano format.
We found that nano-mail demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.