chore(parser): move readme
All checks were successful
Actions / Build and Push Documentation (push) Successful in 15s

This commit is contained in:
cswimr 2025-02-11 09:10:59 -06:00
parent 894751fb0c
commit 1012636f95
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
2 changed files with 6 additions and 6 deletions

89
packages/parser/README.md Normal file
View file

@ -0,0 +1,89 @@
# @packwizjs/parser
[![Documentation](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpackwizjs.csw.im%2Fcoverage.json&query=%24.percent&suffix=%25&logo=typescript&logoColor=%233178C6&label=Documentation&color=%233178C6)](https://packwizjs.csw.im)
A simple JavaScript module to parse the contents of [Packwiz](https://github.com/packwiz/packwiz) index files.
## Installation
You can install PackwizJS with your package manager of choice.
### npm
```sh
npm install --save @packwizjs/parser
```
### pnpm
```sh
pnpm add @packwizjs/parser
```
### yarn
```sh
yarn add @packwizjs/parser
```
### bun
```sh
bun add @packwizjs/parser
```
## Usage
See the [documentation](https://packwizjs.csw.im) for more information.
### Basic Example
```ts
> import { parsePackwiz } from "packwizjs";
> const packwizFile = await parsePackwiz("./packwiz/pack.toml")
Packwiz {
location: Resource { path: 'packwiz/pack.toml' },
index: { // The index file is automatically parsed alongside the pack.toml file
location: Resource { path: 'packwiz/index.toml' },
hash: '6ce48b376540c840b9c2c1eaedbdf64f3b0e1203888ea644fc5d8fff66377c18',
hashFormat: 'sha256',
files: [
[IndexFileEntry],
[IndexFileEntry],
[IndexFileEntry],
[IndexFileEntry]
]
},
name: 'PackwizJS Testing Pack',
packFormat: 'packwiz:1.1.0',
authors: [ 'cswimr', 'GalacticFactory' ],
description: 'PackwizJS Testing Pack',
version: '1.0.0',
versions: {
minecraft: '1.21.4',
fabric: '0.16.10',
forge: undefined,
neoforge: undefined,
quilt: undefined,
liteloader: undefined
}
}
> await packwizFile.index.files[2].parse()
{
name: 'Fabric API',
filename: 'fabric-api-0.115.1+1.21.4.jar',
side: 'both',
provider: ModrinthProvider {
hash: 'd5e9f87679b5edc9786e651fc481f8861a9cf53ed381890a1cb5e129222d6c5fa99f06045007f8e1fba02da686cdb6db2d99b334a1d23881cb56dfa199932eea',
hashFormat: 'sha512',
url: Resource {
path: 'https://cdn.modrinth.com/data/P7dR8mSH/versions/UnrycCWP/fabric-api-0.115.1%2B1.21.4.jar'
},
modId: 'P7dR8mSH',
versionId: 'UnrycCWP'
},
isOptional: false,
isDefault: true,
description: undefined
}
```

View file

@ -16,7 +16,7 @@
"files": [
"src"
],
"readme": "../../README.md",
"readme": "README.md",
"homepage": "https://packwizjs.csw.im",
"keywords": [
"packwiz",