Socket
Book a DemoInstallSign in
Socket

epf-parser

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epf-parser

Parse iTunes Enterprise Partner Feeds

latest
Source
npmnpm
Version
4.0.3
Version published
Maintainers
1
Created
Source

epf-parser

Parse iTunes Enterprise Partner Feeds.

Usage

'use strict';

const fs = require('fs');
const parse = require('epf-parser');

fs.createReadStream('/tmp/application')
  .pipe(parse((meta, rows) => {
    console.log('meta', meta);
    rows.on('data', row => console.log('row', row));
  }));

Will call back with meta like this, with all the meta k/v pairs in one object, and columns and column types merged:

meta { columns:
   [ { name: 'export_date', type: 'BIGINT' },
     { name: 'application_id', type: 'INTEGER' },
     { name: 'title', type: 'VARCHAR(1000)' },
     { name: 'recommended_age', type: 'VARCHAR(20)' },
     { name: 'artist_name', type: 'VARCHAR(1000)' },
     { name: 'seller_name', type: 'VARCHAR(1000)' },
     { name: 'company_url', type: 'VARCHAR(1000)' },
     { name: 'support_url', type: 'VARCHAR(1000)' },
     { name: 'view_url', type: 'VARCHAR(1000)' },
     { name: 'artwork_url_large', type: 'VARCHAR(1000)' },
     { name: 'artwork_url_small', type: 'VARCHAR(1000)' },
     { name: 'itunes_release_date', type: 'DATETIME' },
     { name: 'copyright', type: 'VARCHAR(4000)' },
     { name: 'description', type: 'LONGTEXT' },
     { name: 'version', type: 'VARCHAR(100)' },
     { name: 'itunes_version', type: 'VARCHAR(100)' },
     { name: 'download_size', type: 'BIGINT' } ],
  primaryKey: 'application_id',
  exportMode: 'INCREMENTAL' }

Will emit rows as data events like this (real data hidden for reasons):

row [ Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string'),
  Buffer('some string') ]

For debugging purposes, every row will have the original raw line attached as .raw.

License

MIT

FAQs

Package last updated on 14 Jun 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