Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

discogs-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

discogs-parser

The streaming parser takes a read stream and returns an async iterator

  • 1.7.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

discogs-parser

The streaming parser takes a read stream and returns an async iterator

const https = require("https");
const { createDiscogsParser } = require("discogs-parser");

// more info here http://data.discogs.com/
const DISCOGS_DATA_URL =
  "https://discogs-data-dumps.s3-us-west-2.amazonaws.com/data/2021/discogs_20210501_artists.xml.gz";

https.get(DISCOGS_DATA_URL, async (httpStream) => {
  for await (const chunk of createDiscogsParser(httpStream)) {
    console.log(chunk.id);
  }

  console.log("done!");
});

You can also read the data dump from disk using fs module (and TypeScript):

import fs from "fs";
import path from "path";
import { Label, createDiscogsParser } from "discogs-parser";

const xmlFile = path.join(__dirname, "discogs_20210501_labels.xml.gz");

async function parseLabels() {
  const stream = createDiscogsParser<Label>(fs.createReadStream(xmlFile));
  for await (const label of stream) {
    console.log(label);
  }
}

parseLabels();

FAQs

Package last updated on 12 Mar 2023

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