@metarr/nfo-parser
v0.3.1
Published
A simple NFO parser (cloned from hqwuzhaoyi/gpt-subtitle packages)
Downloads
13
Readme
@metarr/nfo-parser
A clone of nfo-parser package from hqwuzhaoyi/gpt-subtitle. The original npm module had project dependencies from gpt-subtitle, and i wanted an isolated version for this project.
Introduction
@metarr/nfo-parser
is a simple command-line tool for parsing NFO files and converting their content into JSON format. It is built on Node.js and can be used to handle NFO files containing information about TV series or movies.
Installation
Install @metarr/nfo-parser
globally via npm:
npm install -g @metarr/nfo-parser
Usage
To convert an NFO file to JSON format using nfo-parser, run the following command
nfo-parser --input <path-to-nfo-file> [--output <path-to-json-file>]
--input
- Required, specifies the path to the NFO file to be converted.--output
- Optional, specifies the path to output the JSON file. If not specified, the output is printed to the console.
Using the parser function
To use the parser function in your project, follow these steps:
import { parser } from "@metarr/nfo-parser";
(async () => {
try {
const nfoData = await parser("path/to/yourfile.nfo");
console.log(nfoData); // 输出解析后的 JSON 数据
} catch (error) {
console.error("Error:", error);
}
})();