GithubHelp home page GithubHelp logo

isabella232 / haraka-notes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from haraka/haraka-notes

0.0 0.0 0.0 14 KB

Haraka notes, found at connection.notes and connection.transaction.notes

Home Page: https://www.npmjs.com/package/haraka-notes

License: MIT License

JavaScript 100.00%

haraka-notes's Introduction

Build Status Windows Build Status Code Climate Code Coverage NPM

haraka-notes

Notes are objects that exist on Haraka connections and transactions. Prior to the release of haraka-notes, notes was just an empty object. Now notes is an empty object with two functions:

set (path, value)

Sets a note at a dot delimited path to the specified value. The path can be any number of levels deep and any missing objects in the path are autovivified. Perl refugees, contain yourselves.

connection.transaction.notes.set('queue.wants', 'smtp_forward');

The above command sets connection.transaction.notes.queue.wants to the value 'smtp_forward'.

get (path)

Fetches the value of a note from a given dot delimited path.

connection.transaction.notes.get('queue.wants');

Array Syntax

The get and set functions support passing the path as an array of strings. This might be useful to the type of masochist that has dots in their JS/JSON keys. Example:

connection.transaction.notes.get(['i.do','like','pa.in']);

Note Path Registry

To reduce the likelihood of namespace collisions in Haraka notes, consider registering the note paths your plugins use in the registry.

haraka-notes's People

Contributors

msimerson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.