Amorphous javascript object: Express truths in many forms


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
21Mar 7, 2018Nov 3, 2016Minified + gzip package size for amorph in KB



Amorphous javascript object: Express truths in many forms


Install with npm

$ npm i amorph --save


  // Basic Usage

  const Amorph = require('amorph')
  const amorphHex = require('amorph-hex')
  const amorphInt = require('amorph-int')

  const myBalance  = Amorph.from(amorphHex, '0101')
  // >> 257, (int) => {
    return int - 2
  // >> 'ff'

  // Custom Converters
  const AmorphConverter = require('amorph/lib/AmorphConverter')
  const amorphAscii = new AmorphConverter((uint8Array) => {
    // Given a uint8Array, returns ascii
    return asciiEncoder.encode(uint8Array)
  }, (ascii) => {
    // Given ascii, returns uint8Array
    return asciiEncoder.decode(ascii)

  Amorph.from(amorphAscii, 'hello world!').to(hexConverter)
  // >> 68656c6c6f20776f726c6421

Running tests

Install dev dependencies:

$ npm i -d && npm test


Pull requests and stars are always welcome. For bugs and feature requests, please create an issue


Copyright © 2016 Licensed under the MIT license.

This file was generated by readme-generator on November 03, 2016.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from