@nsis/nlf
TypeScript icon, indicating that this package has built-in type declarations

0.12.0 • Public • Published

nlf

License Version Build

Parser and stringifier for NSIS Language Files (.nlf)

Installation

npm install @nsis/nlf

Usage

import * as NLF from "@nsis/nlf";

Example usage in script:

// Read an NSIS Language File
const languageFile = fs.readFileSync(
	"Contrib/Language files/English.nlf",
	"utf8",
);

const languageObj = NLF.parse(languageFile);
const languageNew = NLF.stringify(languageObj);

Methods

parse

Usage: parse(string, options)

Parses an NSIS Language File, constructing an object or JSON string that's easy to query

options.stringify

Type: boolean

Return a stringified object

options.minify

Type: boolean

Minifies a stringified object, requires options.stringify to be true

stringify

Usage: stringify(Object|string)

Converts an NSIS Language File object or JSON string to an .nlf string

options.eol

Type: "crlf" | "lf"

Selects the default end of line sequence. When not specified, it defaults to "crlf" on Windows and "lf" elsewhere.

Related

  • nlf-cli - command-line tool to convert NLF files

License

This work is licensed under The MIT License

Package Sidebar

Install

npm i @nsis/nlf

Weekly Downloads

4

Version

0.12.0

License

MIT

Unpacked Size

12.3 kB

Total Files

6

Last publish

Collaborators

  • idleberg