open-index/open-npm huggingface dataset:
npm package: @stomp/logger
Description: Logger featuring multiple appenders
Author: deepak@kreatio.com
Latest version: 0.0.4

# Logger

An Angular Logger service with multiple Appenders.

## Install

```bash
$ npm i @stomp/logger
```

## Usage

Create an Injectable class and a way to create it in `logger-service.ts`

```typescript
// Define a class that can be injected by Angular DI
@Injectable({
  providedIn: 'root',
})
export class LoggerService extends Logger {}

// As per your application logic
const userId = '9be7ecd3-b706-43ee-9114-628241a808bd';
const sessionId = '972e139d-2426-4955-b2f9-74532e790722';

export function initLoggerService(rxStomp: RxStompService): LoggerService {
  // STOMP Appender will publish each log message to the provided destination
  const stompAppenderConfig = {
    // mandatory, the STOMP destination, typically a header/topic Exchange
    dest: '/exchange/user-log',
    // Minimum severity level to log
    level: LogLevel.DEBUG,
    // Provide a header for each log message
    // You may also alter the message
    formatter: message => ({
      headers: {
        user: userId,
        session: sessionId,
        ts: `${Date.now()}`,
      },
      message,
    }),
  };
  const stompAppender = new StompAppender(stompAppenderConfig, rxStomp);

  // Console Appender will show the messages on the console
  // The console does not have a call for `fatal` to that will be logged using
  // `console.error`
  const consoleAppender = new ConsoleAppender({
    // Minimum severity level to log
    level: LogLevel.DEBUG,
    // This is optional - it allows to modify the message being logged.
    // You can return an Array which will be passed to the console method
    // You may also alter the message.
    formatter: message => [new Date(), message],
  });

  const config: LoggerConfig = {
    // You can use any number of appenders
    appenders: [stompAppender, consoleAppender],
  };

  return new LoggerService(config);
}
```

Provide a `LoggerService`, typically in `app.modules.ts`

```typescript
@NgModule({
  // ...
  providers: [
    // ...
    {
      provide: LoggerService,
      useFactory: initLoggerService,
      deps: [RxStompService],
    },
  ],
  bootstrap: [AppComponent],
})
```

To log messages:

```typescript
// debug, info, warn, error, fatal (same as Ruby logger, or Log4J
logger.debug('my debug message');
```

## New Appender

Implementing a new Appender is not complicated.
See code for existing Appenders for help.

## Watching the messages live

To watch the messages live, please use the [watch.rb ruby script](examples/ruby-sample/) 
(using `bunny` gem for AMQP).
npm package: @stomp/ng2-stompjs
Description: Angular 6/7/8/9/10 [![Build Status](https://travis-ci.org/stomp-js/ng2-stompjs.svg?branch=master)](https://travis-ci.org/stomp-js/ng2-stompjs)
Author: Deepak Kumar
Latest version: 8.0.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @stomp/ng2-stompjs

Angular 6/7/8/9/10 [![Build Status](https://travis-ci.org/stomp-js/ng2-stompjs.svg?branch=master)](https://travis-ci.org/stomp-js/ng2-stompjs)

An Angular (Angular6+) style wrapper for [@stomp/stompjs].

## Version Compatibility

The current version is 8.x.x.
The underlying [@stomp/stompjs] has been bottom rewritten bringing strict compatibility
with [STOMP standards].
This is the first-ever STOMP JS client library that reliably supports binary payloads.

This version is recommended for Angular6 and higher.

It has been reported to work with ionic projects as well.

## Getting started

[https://stomp-js.github.io/](https://stomp-js.github.io/) has tutorials and documentation.

## Upgrading

Please follow [migration guides].

## Documentation

- **Highly recommended** step by step guide at [ng2-stompjs with Angular 7]
- Upgrade instructions at [migration guides]
- API documentation is located at: [API Docs]
- [Using STOMP with SockJS]
- [Change Log](Changelog.md)
- [Contributing](Contributing.md)

## Samples

- [stomp-js/ng2-stompjs-angular7] - final output of [ng2-stompjs with Angular 7].
  This has been tested for Angular 10 as well.
- The original Angular 6 demo upgraded as per [migration guides].
  at [Angular 6 ng2stompjs 7].

## Older Angular versions

Version 4.x.x may be used with Angular 2/4/5 - use dependency like "^4.0.0".
Documentation for 4.x.x can be accessed at
[https://stomp-js.github.io/ng2-stompjs/](https://stomp-js.github.io/ng2-stompjs/).

## Contributors

- [Sam Finnigan](https://github.com/sjmf)
- [Jimi (Dimitris) Charalampidis](https://github.com/JimiC)
- [Deepak Kumar](https://github.com/kum-deepak)
- Astha Deep
- [Michel Promonet](https://github.com/mpromonet)
- Everyone involved at https://github.com/stomp-js/stomp-websocket

## License

Apache-2.0

[@stomp/stompjs]: https://github.com/stomp-js/stompjs
[STOMP standards]: https://stomp.github.io/stomp-specification-1.2.html
[API Docs]: https://stomp-js.github.io/api-docs/latest/
[ng2-stompjs with Angular 7]: https://stomp-js.github.io/guide/ng2-stompjs/ng2-stomp-with-angular7.html
[migration guides]: https://stomp-js.github.io/#upgrading
[Using STOMP with SockJS]: https://stomp-js.github.io/guide/stompjs/rx-stomp/ng2-stompjs/using-stomp-with-sockjs.html
[stomp-js/ng2-stompjs-angular7]: https://github.com/stomp-js/ng2-stompjs-angular7
[Angular 6 ng2stompjs 7]: https://github.com/stomp-js/ng6-stompjs-demo/tree/ng2-stompjs-v7
npm package: @stomp/tcp-wrapper
Description: TCP wrapper for NodeJS sockets to use STOMP over TCP with @stomp/stompjs and @stomp/rx-stomp
Author: deepak@kreatio.com
Latest version: 1.0.1

# STOMP over TCP for Node.js with @stomp/rx-stomp or @stomp/stompjs

This repository contains a wrapper that allows using Node.js TCP sockets to be used with the [@stomp/rx-stomp] and [@stomp/stompjs] libraries for STOMP over TCP communication.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

- [Node.js](https://nodejs.org/)
- [@stomp/rx-stomp] or [@stomp/stompjs]

### Installing

```bash
$ npm i @stomp/tcp-wrapper
```

In addition, you must install one of [@stomp/rx-stomp] or [@stomp/stompjs].

### Usage

#### With [@stomp/rx-stomp]

```javascript
import { TCPWrapper } from '@stomp/tcp-wrapper';
import { RxStomp } from '@stomp/rx-stomp';

const rxStomp = new RxStomp();
rxStomp.configure({
  // hostname (or ip addess) and port number of the STOMP broker
  webSocketFactory: () => new TCPWrapper('127.0.0.1', 61613),
  heartbeatOutgoing: 20000,
  heartbeatIncoming: 20000,
  debug: console.log,
});

const subscription = rxStomp
  .watch({ destination: '/topic/test-rx' })
  .subscribe(message => console.log(message.body));

rxStomp.activate();

rxStomp.publish({
  destination: '/topic/test-rx',
  body: 'First message to RxStomp',
});

setTimeout(async () => {
  subscription.unsubscribe();
  await rxStomp.deactivate();
}, 3000);
```

#### With [@stomp/stompjs]

```javascript
import { Client } from '@stomp/stompjs';
import { TCPWrapper } from '@stomp/tcp-wrapper';

const client = new Client({
  // hostname (or ip addess) and port number of the STOMP broker
  webSocketFactory: () => new TCPWrapper('127.0.0.1', 61613),
  heartbeatOutgoing: 20000,
  heartbeatIncoming: 20000,
  debug: console.log,
  onConnect: () => {
    client.subscribe('/topic/test01', message =>
      console.log(`Received: ${message.binaryBody}`)
    );
    client.publish({ destination: '/topic/test01', body: 'First Message' });
  },
});

client.activate();

setTimeout(() => client.deactivate(), 3000);
```

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/stomp-js/tcp-wrapper/tags).

## Authors

- [Deepak Kumar](https://github.com/kum-deepak)

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.

[@stomp/stompjs]: https://github.com/stomp-js/stompjs
[@stomp/rx-stomp]: https://github.com/stomp-js/rx-stomp