node package manager


Collection of scripts for everyday use. Run simple unit test, generate MAC address, object caching, logging or server files with a simple server.

There are two ways to install the bodhi-scripts. The first is for the stand alone tools the second for the library.

    npm install -g bodhi-scripts
    npm install bodhi-scripts
    cd bodhi-scripts

Implementation of the Google authenticator. Time base one-time token from 80-bit secret. The secret must be base32 encoded.

Super simple cli arguments.

Supports flags like: -m -O2 --long --no-error Every detected flag is set true:

    var arguments = require('bodhi-scripts').args.initialize();
    arguments['m'] === true
    arguments['no-error'] === true

Supports parameters like: -x 123 --message "Hello World!" Every detected parameter is set to its value:

    var arguments = require('bodhi-scripts')
        .setValueFlag('x', '')
        .setValueFlag('message', '')
    arguments['x'] === '123'
    arguments['message'] === 'Hello World!'

Unused arguments are added to the 'unbound' array.

Simple user database in a JSON file.

Generate random MAC addresses.

There are four log levels as strings: 'debug', 'info', 'warning' and 'error'. For disabling logging use: 'none'


var logger = require('bodhi-scripts').logger;
var options = {
    filePath: '/tmp',           // where to save log files 
    filename: 'bodhi-logger',   // name of the log 
    fileSeparator: ';',
    fileExtension: 'log',       // file extension of the log file 
    fileLogLevel: 'warning',    // minumum log level for log files, use 'none' for no logging 
    fileColor: false,
    consoleSeparator: '\t',
    consoleLogLevel: 'debug',   // minimum log level for console 
    consoleTimestamp: true,     // enable time stamp for console logs 
    consoleColor: true         // enable colors in console log 
logger.logDebug('This is a debug message.');
logger.logInfo('This is some information.')
logger.logWarning('This is a warning message.')
logger.logError('This is really bad!');

Simple unit test framework.

Simple file server to instantly share folders.

Execute JSON remote procedure calls and implement JSON RPC services.