Socket
Socket
Sign inDemoInstall

@5stones/onix

Package Overview
Dependencies
2
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @5stones/onix

A strongly typed library for parsing ONIX feeds.


Version published
Maintainers
3
Install size
2.78 MB
Created

Readme

Source

ONIX

A strongly typed library for parsing ONIX feeds.

Usage

At a high level, you can pass an XML string into the parse function which will return an object of type ONIXMessageRoot.

import { parse } from '@5stones/onix';

const someONIXMessage = '...';
const parsed = parse(someONIXMessage);

There are also numerous interfaces, enums, and other data that can be used for strong typing and parsing (e.g. BISAC data).

There are also the following helpers for dealing with BISAC:

import {
  getBISACLabelsForCode,
  getBISACCodeForLabel,
  getBISACAncestorForCode,
  type BISACNode,
} from '@5stones/onix';

const labels: string[] = getBISACLabelsForCode('...');
const code: string = getBISACCodeForLabel('...');
const ancestor: BISACNode | undefined = getBISACAncestorForCode('...');

Code Generation

If you need to update the BISAC codes/labels and/or the ONIX enums you can use the two scraper scripts that scrape the relevant documentation websites and generate the code:

yarn generate:bisac
yarn generate:onix-enums

Release

The standard release command for this project is:

yarn version [--new-version <newversion> | major | minor | patch ]

This command will:

  1. Generate/update the Changelog
  2. Bump the package version
  3. Tag & pushing the commit

e.g.

yarn version --new-version 1.2.17
yarn version patch // 1.2.17 -> 1.2.18

Keywords

FAQs

Last updated on 03 Apr 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc