New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wdf-to-json

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

wdf-to-json

JangoMail Web DB Format to JSON

  • 0.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jm-wdf-to-json

This package contains the code necessary to convert the JangoMail Web DB Format to JSON.

Contributing

Review the Contributing Guidelines before making changes

Install

Latest version

npm install https://bitbucket.org/jangocode/jm-wdf-to-json.git

Specific version

npm install https://bitbucket.org/jangocode/jm-wdf-to-json.git\#0.0.1

(where 0.0.1 is the tagged version)

Example

const wdfToJson = require('jm-wdf-to-json');

let data = 'EmailAddress,FirstName,LastName___ASDF---BREAKjohn@example.comWG0COLWG0JohnWG0COLWG0DoeWG0ROWWG0WANGO-ENDOFDATASTREAM';

try {
  let json = wdfToJson.parse(data);

  console.log(JSON.stringify(json));
} catch (err) {
  console.error(err);
}

Terms

WDF

Web DB Format

Background

When making a connection to a web database, JangoMail uses a custom format to define the header, rows, columns, and data end.

Header

The header is comprised of a comma separated list of strings, with ___ASDF---BREAK appended to the end.

Data

The data is column delimited by WG0COLWG0 and row delimited by WG0ROWWG0.

File End

The end of the file is marked by a final WANGO-ENDOFDATASTREAM.

Example

Using this example:

EmailAddressFirstNameLastName
john@example.comJohnDoe
jane@example.comJaneDoe
alice@example.comAliceSmith

This is how this would represented in WDF (without newline breaks as shown in this example):

EmailAddress,FirstName,LastName___ASDF---BREAK
john@example.comWG0COLWG0JohnWG0COLWG0DoeWG0ROWWG0
jane@example.comWG0COLWG0JaneWG0COLWG0DoeWG0ROWWG0
alice@example.comWG0COLWG0AliceWG0COLWG0SmithWG0ROWWG0
WANGO-ENDOFDATASTREAM

And this is what this module will convert it to:

[
  {
    "EmailAddress": "john@example.com",
    "FirstName": "John",
    "LastName": "Doe"
  },
  {
    "EmailAddress": "jane@example.com",
    "FirstName": "Jane",
    "LastName": "Doe"
  },
  {
    "EmailAddress": "alice@example.com",
    "FirstName": "Alice",
    "LastName": "Smith"
  }
]

FAQs

Package last updated on 15 Oct 2018

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc