open-index/open-npm huggingface dataset:
npm package: @spark.ts/handler
Description: a discord.js handler in typescript
Author: durocodes
Latest version: 1.6.4

# Spark Handler

> A Discord.js Handler built on [TypeScript](https://typescriptlang.org) <img src="https://raw.githubusercontent.com/remojansen/logo.ts/master/ts.png" width="15"/>

## **Installation**

- To install, run `npm i @spark.ts/handler`.

## **Example Usage**

**TypeScript / ESM**
```ts
import { SparkClient } from '@spark.ts/handler';

const client = new SparkClient({
  intents: ['Guilds', 'MessageContent', 'GuildMessages'], // djs intents
  directories: {
    commands: './src/commands', // point this to the ./dist/commands directory if you're using typescript
  },
  logLevel: 'info', // log level used for the logger, if this is on `debug`, you'll see debug messages
});

client.login(process.env.DISCORD_TOKEN);
```

**CommonJS**
```js
const { SparkClient } = require('@spark.ts/handler');

const client = new SparkClient({
  intents: ['Guilds', 'MessageContent', 'GuildMessages'], // djs intents
  directories: {
    commands: './src/commands', // point this to the ./dist/commands directory if you're using typescript
  },
  logLevel: 'info', // log level used for the logger, if this is on `debug`, you'll see debug messages
});

client.login(process.env.DISCORD_TOKEN);
```
npm package: @spark.ts/logger
Description: a logger that extends the native console
Author: durocodes
Latest version: 1.4.0

# Spark Logger

> A logger built on [TypeScript](https://typescriptlang.org) <img src="https://raw.githubusercontent.com/remojansen/logo.ts/master/ts.png" width="15">

## **Installation**

- To install, run `npm i @spark.ts/logger`.
- Usage:

## **Example Usage**

**TypeScript / ESM**
```ts
import { Logger } from '@spark.ts/logger';

const logger = new Logger();
logger.error('An error occured');
```

**CommonJS**
```js
const { Logger } = require('@spark.ts/logger');

const logger = new Logger();
logger.error('An error occured');
```

**NOTE:** You can use all of the functions from the regular console, such as `console.log('hello world')` becomes `logger.log('hello world')`

## **Types**

- There are built-in type declarations, the options for `new Logger();` are below:

```ts
new Logger({
  logLevel: 'success' | 'error' | 'warn' | 'info' | 'debug', // Defaults to 'debug'
  logStyle: 'highlight' | 'bracket', // Defaults to 'highlight'

  // Optional custom messages for the logger. Use {msg} to represent the thing being logged
  messages: {
    success: 'SUCCESS: {msg}',
    error: 'ERROR: {msg}',
    warn: 'WARN: {msg}',
    info: 'INFO: {msg}',
    debug: 'DEBUG: {msg}',
  }
});
```

## **Images**

**Highlight Style:**

![](https://github.com/DuroCodes/spark/blob/main/packages/logger/images/highlight.png)

**Bracket Style:**

![](https://github.com/DuroCodes/spark/blob/main/packages/logger/images/bracket.png)