Skip to content

kodyl/sti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sti

Audit trail for node

'use strict';

import Sti from './src';
import fs from 'fs';

// Create a new Sti
const sti = new Sti('example-sti');


// Sti can connect to a writable stream
const stream = fs.createWriteStream('./log/test.log');
sti.connect( stream );


// ...or the built in writable streams
sti.connect( process.stdout, { target: 'default-data' } );


// Or use a custom function that will be called on every audit.
sti.connect( function(audit) {
  /* ...connect to something here... */
}, { action: 'default-audit-data' });


// Make an audit. All listeners will receive this audit
sti.audit({
  actor: '2321434',
  target: '2e12ff2',
  action: 'changed-email',
  data: {
    before: '[email protected]',
    after: '[email protected]'
  }
});

About

Audit trail for node

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published