1.0.4 • Published 1 year ago

@achilleus/obfuscate v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

obfuscatestring

11ty plugin for obfuscating strings

This plugins enables the obfuscating of strings. I mainly use it to prevent harvesting.

Install

$ npm install @achilleus/obfuscatestring

Configuration

In the upper section of your configuration file, usually .eleventy.js, add the following

const obfuscate = require("@achilleus/obfuscate");

Within the module.exports functionality, add

 eleventyConfig.addPlugin(obfuscate);

Usage

In your templates, you now can add the filter to the output:

{{ 'foo@bar.org' | obfuscate | safe }}

In the generated file this will be outputted as

foo@bar.org

However, the visitor of your site will see

foo@bar.org

The Nunjucks safe filter prevents the output from being escaped. See https://www.11ty.dev/docs/layouts/

Buy me a coffee

If you like this plugin, you can Buy me a coffee.

Credits

Inspiration was taken from the example at https://coderwall.com/p/jpd4zq/simple-method-to-obfuscate-strings-in-javascript by David Long

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago