Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stagas/everyday-node

Everyday node utilities.
https://github.com/stagas/everyday-node

Last synced: 14 days ago
JSON representation

Everyday node utilities.

Awesome Lists containing this project

README

        


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

- [everyday-utils](https://npmjs.org/package/everyday-utils) by [stagas](https://github.com/stagas) – Everyday utilities
- [get-pty-output](https://npmjs.org/package/get-pty-output) by [CyriacBr](https://github.com/CyriacBr) – Execute an external command with a PTY, from Node

## Contributing

[Fork](https://github.com/stagas/everyday-node/fork) or [edit](https://github.dev/stagas/everyday-node) and submit a PR.

All contributions are welcome!

## License

MIT © 2022 [stagas](https://github.com/stagas)