Socket
Book a DemoInstallSign in
Socket

epf-pg-importer

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epf-pg-importer

Take parsed Apple iTunes Enterprise Partner Feed data and import it into a PostgreSQL table, using a streaming `COPY`.

latest
Source
npmnpm
Version
4.1.1
Version published
Maintainers
1
Created
Source

epf-pg-importer

Take parsed Apple iTunes Enterprise Partner Feed data and import it into a PostgreSQL table, using a streaming COPY.

Usage

'use strict';

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

var client = new pg.Client;
client.connect(err => {
  if (err) throw err;

  console.log('Starting import...');

  fs.createReadStream('/Users/julian/Downloads/itunes20160518/application')
    .pipe(parse((meta, rows) => {
      pgImport({
        client,
        table: 'application',
        meta
      }, (err, copy) => {
        if (err) throw err;

        rows.pipe(copy).on('finish', () => {
          console.log('Done! Disconnecting...');
          client.on('drain', () => client.end());
        });
      });
    }));
  
});

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