You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

netstringify

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

netstringify

A simple module to generate and parse netstring format

1.0.0
latest
Source
npm
Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

netstringify

A module to generate and parse netstring formats

Install

    npm install netstringify

Usage

netstringify

Generate netstring format from normal text.

    import netstringify from 'netstringify';

    let text = 'hello world!';
    let netstring = netstringify(text);
    //netstring will be '12:hello world!,'

    //Array of text:
    text = [ 'hello world!', 'Foo Bar Foobar!!!', 'hickery dickery dock'];
    netstring = netstringify(text);
    //netstring will be '12:hello world!,17:Foo Bar Foobar!!!,20:hickery dickery dock,'

parse

Parse/convert a netstring format to normal text.

    import { netstringify, parse } from 'netstringify';

    let text = 'hello world!';
    let netstring = netstringify(text);
    //netstring will be '12:hello world!,'
    let parsed = parse(netstring);
    //parsed will be 'hello world!'

    //Array of text:
    text = [ 'hello world!', 'Foo Bar Foobar!!!', 'hickery dickery dock'];
    netstring = netstringify(text);
    //netstring will be '12:hello world!,17:Foo Bar Foobar!!!,20:hickery dickery dock,'
    parsed = parse(netstring);
    //Parsed will be [ 'hello world!', 'Foo Bar Foobar!!!', 'hickery dickery dock']

Keywords

netstring

FAQs

Package last updated on 10 Mar 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