Socket
Socket
Sign inDemoInstall

@already-existed/email-obfuscator

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @already-existed/email-obfuscator

Lib for obfuscate email on server and unobfuscate on client.


Version published
Weekly downloads
12
increased by33.33%
Maintainers
1
Install size
20.4 kB
Created
Weekly downloads
 

Readme

Source

EmailObfuscator

Lib for obfuscate email on server and unobfuscate on client.

Installation

npm i -S @already-existed/email-obfuscator

Usage

<!-- html -->
<a data-email="true" href="mailto:[email-href]some-email@some.com[/email-href]">
  [email]some-email@some.com[/email]
</a>
// server
import { obfuscateEmail } from '@already-existed/email-obfuscator'

...
res.send(obfuscateEmail(html))
...
// client
import { unobfuscateEmail } from '@already-existed/email-obfuscator'

window.addEventListener('load', () => {
  unobfuscateEmail()
})

Options


// 'binary' - slow
// 'base64' - fast
type ObfuscateType = 'binary' | 'base64'

interface ObfuscateOptions {
  type?: ObfuscateType // default: 'binary'
}

obfuscateEmail(value: string, opts?: ObfuscateOptions): string
unobfuscateEmail(opts?: ObfuscateOptions): void

Keywords

FAQs

Last updated on 16 May 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc