leroycep / node-opendkim

node.js language binding for libopendkim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Codefresh build status NPM

node-opendkim

node.js native language binding to libopendkim

Install/Test Locally (from source)

git clone git@github.com:godsflaw/node-opendkim.git
cd node-opendkim
npm install
npm test -- --verbose

Install Locally (npm)

npm install --save node-opendkim

Install Globally (npm)

npm install --global node-opendkim

Compile (Development)

node-gyp rebuild


Usage

Verify

const OpenDKIM = require('node-opendkim');

try {
  var opendkim = new OpenDKIM();
  opendkim.verify({
    id: undefined // optional (default: undefined)
  });

  // Adding one header at a time, when finished call opendkim.eoh()
  var header = 'From: <herp@derp.com>';
  opendkim.header({
      header: header,
      length: header.length
  });
  opendkim.eoh();

  // Adding body chunks, when finished call opendkim.eom().  This too
  // can take many chunks.  Do NOT include the terminating DOT.
 var body = 'this is a test';
  opendkim.body({
      body: body,
      length: body.length
  });
  // This does the final validation, and will throw an error if there is one.
  opendkim.eom();
} catch (err) {
  console.log(err);
}

API Administration

API Processing

API Signing

API Verifying

API Utility


License

MIT © Christopher Mooney

About

node.js language binding for libopendkim

License:MIT License


Languages

Language:JavaScript 67.6%Language:C++ 32.1%Language:Python 0.4%