Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@ahmedayob/email-toolkit
Advanced tools
The Base64 utility class is a lightweight JavaScript library designed for encoding and decoding Base64 strings on the client side. It provides simple and efficient methods to convert text to Base64, decode Base64 back to text, and handle Base64 encoded da
@ahmedayob/email-builder
is a TypeScript library for building and manipulating MIME (Multipurpose Internet Mail Extensions) messages. This library provides an easy-to-use API for creating, modifying, and encoding MIME messages, making it ideal for email and other internet-based communication systems.
You can install @ahmedayob/email-builder
using npm or yarn:
npm install @ahmedayob/email-builder
or
yarn add @ahmedayob/email-builder
Here’s a basic example of how to use the @ahmedayob/email-builder
library:
import { MimeBuilder, Base64 } from "@ahmedayob/email-builder";
// Create a new MIME message
const mimeMessage = new MimeBuilder();
mimeMessage.setHeader("From", "sender@example.com");
mimeMessage.setHeader("To", "recipient@example.com");
mimeMessage.setHeader("Subject", "Hello World");
mimeMessage.setHeader("Reply-To", "reply@example.com");
// Add a text part
mimeMessage.addPart({
type: "text/plain",
content: "This is a sample email message.",
});
// Generate MIME boundaries
mimeMessage.generateBoundaries();
// Retrieve headers
const headers = mimeMessage.getHeaders();
console.log(headers);
// Encode a string to Base64
const encodedString = Base64.encodeToBase64("Sample content");
console.log(encodedString);
// Decode a Base64 string
const decodedString = Base64.decodeToBinary(encodedString);
console.log(decodedString);
setHeader(name: string, value: unknown): string
Sets a MIME header with the given name and value.
getHeader(name: string): string
Retrieves the value of a specified MIME header.
setHeaders(obj: Record<string, unknown>): string[]
Sets multiple headers from an object where keys are header names and values are their corresponding values.
getHeaders(): Record<string, unknown>
Retrieves all headers as an object.
generateBoundaries(): void
Generates unique MIME boundaries for different parts of the message.
isArray(v: unknown): v is Array<unknown>
Checks if a value is an array.
isObject(v: unknown): v is Object
Checks if a value is an object.
encodeToBase64(input: string): string
Encodes a string into Base64.
decodeToBinary(input: string): string
Decodes a Base64 encoded string into its original binary form.
deccodeToBuffer(input: string): Buffer
Decodes a Base64 encoded string into a Buffer object.
toBufferURI(input: string): string
Encodes a string to Base64 and then URI encodes the result.
This project is licensed under the MIT License. See the LICENSE file for more details.
For questions or feedback, please reach out to ahmedayobbusiness@gmail.com.
This README provides a clear overview of the package, including its features, installation instructions, basic usage, API details, and contact information. Make sure to adjust any details if necessary, and add any additional sections or links that may be relevant.
0.1.7
FAQs
A powerful and flexible toolkit for building, validating, and processing emails with TypeScript. This library offers utilities for handling email headers, attachments, and encoding, making it easier to compose and manage emails programmatically.
The npm package @ahmedayob/email-toolkit receives a total of 1 weekly downloads. As such, @ahmedayob/email-toolkit popularity was classified as not popular.
We found that @ahmedayob/email-toolkit demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.