1.1.5 • Published 6 years ago

nodetools v1.1.5

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

NodeTools Build Status

NodeTools is a package that provides set of commonly used functionality such as hashing and encoding.

Installation

Using command line

npm i --save nodetools

Functionality

Currently, the below functions are supported. more to come in the future.

  • MD5: hash(str, 'md5'); or hash(str);
  • SHA1: hash(str, 'sha1');
  • SHA256: hash(str, 'sha256');
  • SHA512: hash(str, 'sha512');
  • Validate Email: validateEmail(str);
  • Check if is numeric: isNumeric(nunmber);
  • Base64 encode/decode: base64Encode(str); and base64Decode(str);
  • Check if variable is set: isSet(var);
  • URL encode/decode: urlEncode(str); and urlDecode(str);
  • Detect mime-type: detectType(str);

Example

var ntools = require('nodetools');

console.log(ntools.hash('a')); // MD5 by default
console.log(ntools.hash('a', 'sha1')); // SHA1
console.log(ntools.base64Encode('a')); // Base64 encode
console.log(ntools.detectType('json')); // application/json

If you have ES6 support:

import { hash, base64Encode, detectType } from 'nodetools';

console.log(hash('a')); // MD5 by default
console.log(hash('a', 'sha1')); // SHA1
console.log(base64Encode('a')); // Base64 encode
console.log(detectType('json')); // application/json

Issues ?

https://github.com/alzubaidi/ntools/issues

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.0.2

8 years ago

1.0.0

9 years ago