Have ideas to improve npm?Join in the discussion! »

    This package has been deprecated

    Author message:

    This module has moved and is now available at @hapi/subtext. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.

    subtext

    6.0.12 • Public • Published

    subtext

    HTTP payload parser.

    Build Status

    Lead Maintainer: Eran Hammer

    subtext parses the request body and returns it in a promise.

    Example

    const Http = require('http');
    const Subtext = require('subtext');
     
    Http.createServer(async (request, response) => {
     
      const { payload, mime } = await Subtext.parse(request, null, { parse: true, output: 'data' });
     
      response.writeHead(200, { 'Content-Type': 'text/plain' });
      response.end(`Payload contains: ${JSON.stringify(payload)}`);
     
    }).listen(1337, '127.0.0.1');
     
    console.log('Server running at http://127.0.0.1:1337/');
     

    API

    See the API Reference

    Install

    npm i subtext

    DownloadsWeekly Downloads

    122,196

    Version

    6.0.12

    License

    BSD-3-Clause

    Unpacked Size

    14.3 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar