@skyrim-platform/console-util
TypeScript icon, indicating that this package has built-in type declarations

1.3.3 • Public • Published

@skyrim-platform/console-util

(Unofficial) TypeScript library for the ConsoleUtil Skyrim modding utility

Getting Started

You can find an example Skyrim Platform plugin with documentation on how to get started using this library: https://github.com/skyrim-platform/example-plugin-using-libraries

Papyrus source code conversion to TypeScript originally generated using Papyrus-2-Typescript

Example

import { on, printConsole } from '@skyrim-platform/skyrim-platform'
import { GetSelectedReference } from '@skyrim-platform/console-util'

// Whenever anything is selected in the ~ Skyrim console, it prints out that object's name in the console
on('update', () => {
    const selectedReference = GetSelectedReference()
    if (selectedReference) {
        let name = selectedReference.getName()
        if (! name) name = selectedReference.getDisplayName()
        if (! name) name = selectedReference.getBaseObject()!.getName()
        printConsole(`Selected reference: ${name}`)
    }
})

Readme

Keywords

Package Sidebar

Install

npm i @skyrim-platform/console-util

Weekly Downloads

2

Version

1.3.3

License

MIT

Unpacked Size

4.96 kB

Total Files

5

Last publish

Collaborators

  • shevernitskiy
  • mrowrpurr