2019-01-04 05:13:46 +01:00
|
|
|
**PROPOSAL STAGE**
|
|
|
|
|
|
|
|
# LBRY File Format
|
|
|
|
|
|
|
|
The LBRY format is a multimedia-format designed to promote interoperability and transmission of complex digital media.
|
|
|
|
|
|
|
|
## Name
|
|
|
|
|
|
|
|
- Name Format: `*.lbry`
|
|
|
|
- Character Set: `UTF-8`
|
|
|
|
- Extension: `lbry`
|
|
|
|
|
|
|
|
## Metadata
|
|
|
|
|
|
|
|
- Media Type: `application/x-lbry`
|
|
|
|
|
|
|
|
## Container
|
|
|
|
|
|
|
|
- Compression: `Zstandard`
|
|
|
|
- Archival: `tar`
|
|
|
|
|
|
|
|
## Contents
|
|
|
|
|
|
|
|
### Descriptor
|
|
|
|
|
2019-01-06 22:41:49 +01:00
|
|
|
- Format: `JSON`, `UTF-8`
|
|
|
|
|
|
|
|
# lbry-format
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- Node.js v11.6.0 (see https://nodejs.org/docs/v11.6.0/api/esm.html)
|
2019-01-07 02:51:56 +01:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2019-01-07 02:54:12 +01:00
|
|
|
**WARNING:** These method signatures will change as the `JSON` `Descriptor` is finalized.
|
|
|
|
|
2019-01-07 02:51:56 +01:00
|
|
|
Install `npm i https://github.com/lbryio/lbry-format.git`
|
|
|
|
|
|
|
|
### Pack
|
|
|
|
```
|
|
|
|
const lbryFormat = require('lbry-format');
|
|
|
|
|
|
|
|
// Pack `./` to `package.lbry`
|
|
|
|
lbryFormat.packDirectory('./', {
|
|
|
|
fileName: 'package.lbry',
|
|
|
|
});
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
### Unpack
|
|
|
|
```
|
|
|
|
const lbryFormat = require('lbry-format');
|
|
|
|
|
|
|
|
// Unpack `package.lbry` to `./`
|
|
|
|
lbryFormat.unpackDirectory('./', {
|
|
|
|
fileName: 'package.lbry',
|
|
|
|
});
|
|
|
|
|
|
|
|
```
|