Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-treeize

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-treeize

A hapi.js plugin that decorates reply with treeize.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

hapi-treeize

A hapi.js plugin that decorates reply with Treeize functionality. Requires Node v4+.

Install

npm install hapi-treeize

Info

reply.treeize accepts three parameters:

  1. required - the data to be treeized
  2. optional - route specific Treeize options (otherwise uses the defaults you set in server.register OR Treeize defaults if you don't specify any)
  3. optional - a signature for the data

See the Treeize documentation for more information on the options and signature.

Usage

const {Server} = require('hapi')
const HapiTreeize = require('hapi-treeize')

const server = new Server()
server.connection({ port: 8080 })

server.register({
  register: HapiTreeize,
  options: {} // optional, see Treeize docs
}, (err) => {
  if (err) throw err
})

server.route([
  {
    method: 'GET',
    path: '/',
    handler: (request, reply) => reply.treeize({ value: 'data' })
  }
}

server.start((err) => {
  if (err) throw err
})

See more examples in the examples directory.

Tests

npm test

Keywords

FAQs

Package last updated on 24 May 2016

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