Socket
Socket
Sign inDemoInstall

halpert

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

halpert

Package for converting from one media type to another


Version published
Weekly downloads
5
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Halpert

Build Status

Halpert is a library for representing and interfacing with hypermedia formats. It provides a way for converting to and from these formats, along with methods for filtering and parsing through them in a general way.

Install

Use npm to install halpert.

npm install halpert

Supported Formats

  • HAL+JSON - Currently only parses HAL objects

Usage

Initializing and Registering Formats

To initialize a Halpert object and register the formats, require the halpert package along with any formats desired. The example below includes the HAL+JSON format.

var Halpert = require('halpert'),
    halJson = require('halpert-hal-json');

halpert = new Halpert;
halpert.registerFormat(halJson);

Representing Documents

Once you have a Halpert object like above, you can then start representing documents.

var doc = {
  _links: { self: { href: "/customer/4" }},
  full_name: "John Doe",
  email: "john@doe.com"
}

represnter = halpert.represent(doc, 'application/hal+json');

Contributing

  • Please make sure all contributions are covered by tests
  • Run gulp build once all changes are complete

Keywords

FAQs

Package last updated on 27 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc