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

kerchief-parser

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kerchief-parser

Node Kerchief Parser

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

NodeJS Kerchief Parser

Build Status Dependency status codecov Code Climate XO code style

A streaming nodejs Kerchief parser, which validates every message against the JSON schema. Currently up to Kerchief spec draft 01.

Getting Started

Prerequisites

The Kerchief parser assumes a NodeJS environment. So go ahead and make sure you've got that setup, as well as yarn.

Installing

Add Kerchief parser as a dependency:

$ yarn add kerchief-parser

Cool. Now, use it:

const Parser = require('kerchief-parser');

const kerchiefParser = new Parser();

kerchiefParser.on('testStarted', testStarted => {
    console.log(testStarted);
});

kerchiefParser.write(JSON.stringify({
    testStarted: {
        name: "This is my test!",
        id: "5226c9ce-0dc8-4ca5-95f7-23016716be70"
    }
}));

The parser may emit three different types of event:

  • testStarted: the complete Kerchief message
  • testResult: the complete Kerchief message
  • invalidMessage: a TypeError (which your consumer may then throw, if needed).

Running the tests

$ yarn test

Contributing

Pull requests welcome!

Versioning

We use SemVer for versioning.

License

This project is licensed under the MIT License - see the LICENSE file for details

FAQs

Package last updated on 01 Jan 2017

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