Strings

You can easily load your files as strings. YAML? TOML? Let the strings rule them all!

const nnLoader = require('nnloader');

async function main() {
    const myFileContent = await nnLoader.loadString('/files/myFile.txt');
}

JSON

If you want some syntatic sugar you can use the JSON loader to get some nice objects directly.

const nnLoader = require('nnloader');

async function main() {
    const myFileContent = await nnLoader.loadJSON('/configs/config.json');
}

Buffers

If nothing else works, unleash your binary magician skills with NodeJS Buffers!

const nnLoader = require('nnloader');

async function main() {
    const myFileContent = await nnLoader.loadBuffer('/files/someBinary');
}

Pay me a Coffee: