Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

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

235,476

version

6.0.12

license

BSD-3-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability