Socket
Socket
Sign inDemoInstall

hapi-fields

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-fields

Partial responses


Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

Hapi Fields Build Status

This module adds partial response support to Hapi.

Documentation

See JSON Mask for the supported syntax.

Options

  • name (String, default: fields): query parameter

Example

var hapi = require('hapi');

var server = new hapi.Server();
server.connection({ port: 8000 });

server.route({
  method: 'GET',
  path: '/echo',
  handler: function(request, reply) {
    reply({ hello: 'jane', bye: 'john' });
  },
});

server.register({ register: require('hapi-fields') }, function(err) {
  if (err) throw err;
});

server.start();

Usage

$ curl http://127.0.0.1:8000/echo
{"hello":"jane","bye":"john"}
$ curl http://127.0.0.1:8000/echo?fields=hello
{"hello":"jane"}

License

This work is licensed under the MIT License (see the LICENSE file).

Keywords

FAQs

Package last updated on 22 Sep 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