New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

postal-mime

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postal-mime

Email parser for browser environments

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

postal-mime

Email parser for browser environments.

PostalMime can be run in the main web thread or from Web Workers. Expects emails as ArrayBufer values.

Source

Source code is available from Github.

Usage

Free, AGPL-licensed version

First install the module from npm:

$ npm install postal-mime

next import the PostalMime class into your script:

const { PostalMime } = require('postal-mime');

or when using as a global

<script src="/path/to/postal-mime.js"></script>
<script>
    const PostalMime = postalMime.default;
</script>

MIT version

MIT-licensed version is available for Postal Systems subscribers.

First install the module from Postal Systems private registry:

$ npm install @postalsys/postal-mime

next import the postal-mime class into your script:

const { PostalMime } = require('@postalsys/postal-mime');

If you have already built your application using the free version of postal-mime and do not want to modify require statements in your code, you can install the MIT-licensed version as an alias for "postal-mime".

$ npm install postal-mime@npm:@postalsys/postal-mime

This way you can keep using the old module name

const { PostalMime } = require('postal-mime');

Promises

All postal-mime methods use Promises, so you need to wait using await or wait for the then() method to fire until you get the response.

const { PostalMime } = require('postal-mime');
const parser = new PostalMime();
const email = await parser.parse(emailAsAnArrayBuffer);
console.log(email.subject);
console.log(email.html);

License

© 2020 Andris Reinman

Licensed under GNU Affero General Public License v3.0 or later.

MIT-licensed version of postal-mime is available for Postal Systems subscribers.

Keywords

FAQs

Package last updated on 15 Jan 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc