@onichandame/mock-nats-client
    TypeScript icon, indicating that this package has built-in type declarations

    0.0.2 • Public • Published

    Mock NATS Client

    A mocked NATS client for unit test. All messaging actions are carried out in memory only.

    Has the same function signature and typing with the original ts-nats library.

    Author

    onichandame

    Usage

    Installation

    yarn add @onichandame/mock-nats-client

    Connection

    import { connect } from '@onichandame/mock-nats-client'
     
    const nc = await connect()

    Subscribe:

    nc.subscribe('subject', (e, msg) => console.log(msg.data))

    Publish:

    nc.publish('subscribe', {})

    Any feature request or bug report is welcome.

    Keywords

    none

    Install

    npm i @onichandame/mock-nats-client

    DownloadsWeekly Downloads

    3

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    55.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • onichandame