NeXTSTEP Programming Mastermind
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@nsis/nlf

0.8.1 • Public • Published

nlf

npm npm CircleCI David

Parser and stringifier for NSIS Language Files (.nlf)

Installation

yarn add @nsis/nlf || npm install @nsis/nlf

Usage

Use ES6 imports or require() to include the module:

// ECMAScript Import
import * as NLF from '@nsis/nlf';
 
// CommonJS Require
const NLF = require('@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

Related

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

License

This work is licensed under The MIT License

Install

npm i @nsis/nlf

DownloadsWeekly Downloads

16

Version

0.8.1

License

MIT

Unpacked Size

129 kB

Total Files

7

Last publish

Collaborators

  • avatar