unhal
Takes JSON in hal format, and flattens it
Last updated 2 years ago by nonrectangular .
ISC · Original npm · Tarball · package.json
$ cnpm install unhal 
SYNC missed versions from official npm registry.

unhal

Take JSON in HAL format, and canonize it back to a normal JSON object, without the _links and _embedded properties. See http://stateless.co/hal_specification.html for details.

As a command-line tool

Install with npm install -g unhal and then you can pipe JSON through it as a command.

unhal < test.json

As a library

const unhal = require('unhal')

const json = {
  _links: "this will be removed"
  _embedded: {
    foo: "this will be hoisted"
  }
}

const result = unhal(json)

This should result in:

{
  foo: "this will be hoisted"
}

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

1 Versions

  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |