# onix-gen-funstory

a library to generate ONIX

[![npm version](https://img.shields.io/npm/v/onix-gen-funstory.svg?style=flat-square)](https://www.npmjs.com/package/onix-gen-funstory)
[![npm downloads](https://img.shields.io/npm/dm/onix-gen-funstory.svg?style=flat-square)](https://www.npmjs.com/package/onix-gen-funstory)

------

## Usage

Install the lib and add it as a dependency (recommended), run on your project dir:

```bash
yarn add onix-gen-funstory
```

## Demo Code

```javascript
import { ONIXGenerator } from 'onix-gen-funstory';

async function main(){
  const onixGenerator = new ONIXGenerator({
    senderName: 'Funstory',
    contactName: 'Mark Chow',
    emailAddress: 'email@email.com',
    cityOfPublication: 'BeiJing',
    countryOfManufacture: 'CN',
    publisherName: 'Funstory',
    websiteLink: 'https://funstory.ai',
  });
  // Generator initializing
  await onixGenerator.init();

  // ONIX Generating
  const onixResult = await onixGenerator.genONIX({
    bookName: mainBook.bookname,
    volume: volumeIndex + 1,
    author: mainBook.author,
    translator: 'Lemon Novel',//Babel Novel | Lemon Novel | Fancy Novel
    description: mainBook.desc,
    isbn: isbnNum,
    subjectCode: mainBook.subjectCode,
    price: mainBook.price,
    keywords: mainBook.keywords,
    preOrderDate: '2019-09-15',
    publicationDate: '2019-09-20',
    salesRestriction: 'ALL',//ALL TOP_FIVE KINDLE_ONLY(default)
    subTitle: 'sub Title',
    // takedown: true,
    // pageCount: 300,
  });

  console.log(onixResult)
}
```
