@skidy89/ssl.js
v1.1.2
Published
simple language loader - A high-performance language loader for internationalization (i18n) using Rust and N-API, supporting multiline strings, arrays, comments, and caching.
Maintainers
Readme
Simple Language Loader is a fast and lightweight Rust + N-API addon for Node.js that provides a simple yet powerful way to load .lang files with support for arrays, multiline strings, and comments.
It’s designed for multilingual projects that need high performance and easy js/ts integration
features
- Full TypeScript support
- Automatic caching for repeated loads
- Simple and readable api
- Cross-platform Napi bindings
- Comment support (#)
Installation
npm i @skidy89/ssl.jsExample
import { loadChdlang, generateTypescriptDefs, clearLangCache, load_lang_dsk } from "@skidy89/ssl.js"
// create map cached langs
const langs = loadChdlang("./languages")
// or if you prefer, without any cached langs
const uncachlangs = load_lang_dsk("./languages")
console.log(langs.en.HELLO)
console.log(langs.es.GOODBYE)
// generate typescript files, will throw an error if the path doesnt exist
generateTypescriptDefs("./languages", "./types/langs.d.ts")
// clean the cached languages
clearLangCache()[!WARNING] this project is still on development, if you encounter an error, let me know or make a pull request
