open-index/open-npm huggingface dataset:
npm package: @seangarner/rpmbuild
Description: RPM build package for node. This is a wrapper around rpmbuild command line. Forked from azweb76/node-rpmbuild
Author: Dan Clayton
Latest version: 0.0.23

# rpmbuild

This is a node package that wraps the rpmbuild cli making integrating rpmbuild into node a little easier.

Forked from https://github.com/azweb76/node-rpmbuild which appears to have been abandoned.


## Usage

### 1. Install rpmbuild globally:

```
npm install -g @seangarner/rpmbuild
```

### 2. Install rpmbuild in your project dependencies:

```
npm install --save @seangarner/rpmbuild
```

## rpmbuild API

```javascript
var rpm = require('@seangarner/rpmbuild');
rpm.build({
  name: 'myproject',
  summary: 'myproject RPM',
  description: 'this is an RPM for myproject',
  files: {
    '/var/local/myproject': [ 'lib/**', 'node_modules/**' ],
    '/usr/bin': [ 'bin/**' ]
  },
  installScript: ['chown -R myuser:myuser %{buildroot}', 'echo "test" > %{buildroot}/test.txt'],
  version: '0.0.1',
  release: 1,
  url: 'http://myproject/',
  license: 'GPL+',
  group: 'Development/Tools'
}, function(err, result){
  if (err){
    throw new Error('rpm.build failed' + err.toString());
  }
  console.log('done');
});
```
npm package: @seangenabe/abstract-cache-levelup
Description: abstract-cache over levelup
Author: Sean Genabe
Latest version: 1.0.1

# abstract-cache-levelup

`abstract-cache` over `levelup`

## Usage

```javascript
const cache = require('abstract-cache')({
  useAwait: true,
  driver: {
    name: '@seangenabe/abstract-cache-levelup',
    options: {
      location: './db'
    }
  }
})
```

OR

```javascript
const db = level('./db')
const client = new require('@seangenabe/abstract-cache-levelup/client')({
  db
})
const cache = require('abstract-cache')({
  useAwait: true,
  client
})
```

## Options

These are the options for both the function and the client class.

* `db`: The `levelup` instance to use. Overrides `location` and `options`.
* `location`: Location to be passed to `level`.
* `options`: Options to be passed to `level`.
npm package: @seangenabe/apkg
Description: Anki SRS apkg reader/writer
Author: Sean Marvi Oliver Genabe
Latest version: 1.0.0-1

# apkg

Anki SRS apkg reader/writer

## Usage

```typescript
import { pipeline } from "@improved/node/stream"
import { ZipFile } from "yazl"
import { Apkg } from "@seangenabe/apkg"

async function run() {
  const apkg = new Apkg()

  // modify apkg here

  const files = apkg.save()

  const zip = new ZipFile()
  for (let file of files) {
    zip.addReadStream(Readable.from(file.read(), { objectMode: false }), file.name)
  }
  zip.end()
  await pipeline(
    zip.outputStream,
    createWriteStream("output.apkg")
  )
}
```

### class Apkg

Represents an Anki collection file.

#### #constructor()

#### #media: ReadableFile[]

Media files

#### #col: Collection

Collection object.

The `conf`, `models`, `decks`, `dconf`, and `tags` properties need not be assigned as they are assigned with objects from the `Apkg` instance.

#### #conf: CollectionConfiguration

`conf`

#### #models: Model[]

Note types

#### #decks: Deck[]

Decks

#### #dconf: DeckConfiguration[]

Deck options

#### #notes: Note[]

Notes

#### #cards: Card[]

#### #loadFromDb(db: SqlJs.Database)

Loads a collection from an Sql.js database.

#### #saveToDb(db: SqlJs.Database)

Saves the collection to an Sql.js database.

#### #save(): IterableIterator<ReadableFile>

Saves Apkg data to a series of files that can be saved into a `.apkg` zip file.

A `ReadableFile` is an object with a property `name` for the file name and a `read(): AsyncIterableIterator<Uint8Array>` function that reads from a file (Compatible with a node.js Readable stream).

#### #load(files: IterableIterator<ReadableFile>): Promise<void>

Loads Apkg data from a series of files.

## Abstraction of file series and streams

An abstraction of series of files and file streams is chosen so as to leave the choice of choosing a zip-handling implementation to the consumer. Likewise, the stream abstraction is to make the package environment-agnostic (node.js / browser).