npm.io
1.3.0 • Published 3 years ago

everyday-node

Licence
MIT
Version
1.3.0
Deps
2
Size
41 kB
Vulns
0
Weekly
0

everyday-node

Everyday node utilities.

npm i everyday-node pnpm add everyday-node yarn add everyday-node

API

# CharKey

    # char

      string

    # key

      Key

# discoverFileWithSuffixes(pathname, suffixes)

    # pathname

      string

    # suffixes

      string []

    discoverFileWithSuffixes(pathname, suffixes)  =>

      Promise<undefined | string>

# exec(cmd, args, options)

    # cmd

      string

    # args  =  []

      string []

    # options  =  {}

      SpawnOptions

    exec(cmd, args, options)  =>

      Promise<unknown>

# execCapture(cmd, opts)

    # cmd

      string

    # opts

      Options

    execCapture(cmd, opts)  =>

      Promise<ReturnType>

# execCaptureSync(cmd, opts)

    # cmd

      string

    # opts

      Options

    execCaptureSync(cmd, opts)  =>

      ReturnType

# exists(pathname)

    # pathname

      string

    exists(pathname)  =>

      Promise<boolean>

# keypress(msg, cb)

    # msg

      string

    # cb(char, key)

      # char

        string

      # key

        Key

      cb(char, key)  =>

        void

    keypress(msg, cb)  =>

      Promise<
      # ()

        ()  =>

          void

      >

# keypressSync(msg)

    # msg

      string

    keypressSync(msg)  =>

      string

# singleKeypress(msg)

    # msg

      string

    singleKeypress(msg)  =>

# waitForFileExists(pathname, timeout)

    # pathname

      string

    # timeout  =  15000

      number

    waitForFileExists(pathname, timeout)  =>

      Promise<undefined | Deferred<void>>

Credits

Contributing

Fork or edit and submit a PR.

All contributions are welcome!

License

MIT 2022 stagas