0.0.0 • Published 2 years ago

tstl-log-lua v0.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

TSTL json.lua

Declarations for log.lua, A tiny logging module for Lua.

CommandDescription
yarn add -D tstl-log-luaInstall these declarations
yarn add rxi/log.luaInstall log.lua

Upon installation these declarations can be linked to a tsconfig.json file.

{
    "compilerOptions": {
        "types": [
            "tstl-log-lua"
        ]
    }
}

And used within any .ts file.

import * as log from "log";

log.usecolor = true;

log.info("Hello world!");

Make sure to append ";./node_modules/log.lua/?.lua" to your package.path in a conf.ts file (this is run first) to assist where Lua looks for modules.

package.path += ";./node_modules/log.lua/?.lua";

Also you need to add "typescript-to-lua/language-extensions" to tsconfig.json file.

{
    "compilerOptions": {
        "types": [
            "typescript-to-lua/language-extensions"
        ]
    }
}