New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

json-header

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-header

If a message starts with JSON, the JSON is parsed and returned as the header, and the body is returned as everything after the JSON.

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

json-header

A simple protocol and script that interprets a document as consisting of a json header and a body. Use the parseStr function to parse a document into the header and body.

Example node session:

> jh=require('./index.js');
{ parseStr: [Function] }
> jh.parse('{"key":"value","date":"2013-07-10 CST"}body of the document',jh.dateReviver);
{ header: 
   { key: 'value',
     date: 'Wed Jul 10 2013 14:35:03 GMT-0500 (CDT)' },
  body: 'body of the document' }

This software is used in my blog, ryanxcharles.com, but could be used in any case where documents that have a header with meta-information and a body. For instance, hypothetically, you could implement something like HTTP or SMTP with JSON in the header using json-header.

Keywords

json

FAQs

Package last updated on 16 Jul 2013

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