open-index/open-npm huggingface dataset:
npm package: @monterosa/logger
Description: The colorful tool for the NodeJS and browsers logs
Latest version: 0.2.6
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# MLogger [![Downloads](https://img.shields.io/npm/dm/@monterosa/logger.svg)](https://www.npmjs.com/package/@monterosa/logger) [![License](https://img.shields.io/npm/l/@monterosa/logger.svg)](https://github.com/monterosalondon/logger/LICENSE.md) [![ESLint code style](https://img.shields.io/badge/code_style-ESLint-4b33c3.svg)](https://github.com/eslint/eslint) [![GitHub stars](https://img.shields.io/github/stars/monterosalondon/logger.svg?style=social&label=Stars)](https://github.com/monterosalondon/logger)

> The colorful tool for the NodeJS and browsers logs

## Install

```
$ npm install @monterosa/logger
```

## Usage

```
import { LEVELS, setLevel, getLogger } from '@monterosa/logger';

setLevel(LEVELS.DEBUG); // LEVELS.INFO by default

const logger = getLogger('prefix');

logger.info("this is '%s' level", 'info'); // {"@name": "base", "@level":"info","@timestamp":"2018-05-15T09:09:11.781Z","@prefix":"prefix","@message":"this is 'info' level","@splat":["info"]}

logger.warn("this is %j", { level: 'info' }); // {"@name": "base", "@level":"warn","@timestamp":"2018-05-15T09:09:11.782Z","@prefix":"prefix","@message":"this is {\"level\":\"info\"}","@splat":[{"level":"info"}]}

logger.error("Fatal error %s", new Error('some error')); // {"@name": "base", "@level":"error","@timestamp":"2018-05-15T09:09:11.782Z","@prefix":"prefix","@message":"Fatal error Error: some error","@splat":[{}]}

logger.debug("userName=%s, userData=%j", 'z4o4z', data); // {"@name": "base", "@level":"error","@timestamp":"2018-05-15T09:09:11.782Z","@prefix":"prefix","@message":"userName=z4o4z, userData={...}","@splat":['z4o4z', {...}]}
```

## API

* [`LEVELS`](#levels)
* [`setName`](#setName)
* [`setLevel`](#setLevel)
* [`getLogger`](#getLogger)
* [`setTransport`](#setTransport)

### `LEVELS`

The map of available log levels.

```
LEVELS.ERROR // error
LEVELS.WARN // warn
LEVELS.INFO // info
LEVELS.DEBUG // debug
LEVELS.VERBOSE // verbose
LEVELS.SILLY // silly
```

### `setName`

The method to set log name. Useful when you are shared code between processes and want to specify for which process the log was called. By default name is `base`. Can be called in runtime.

```
setName('some name');
```

### `setLevel`

The method to set log level. Gets level as an argument. By default level is `LEVELS.INFO`. Can be called in runtime.

```
setLevel(LEVELS.DEBUG);
```

### `getLogger`

The method gets some prefix and returns logger instance with methods below:

```
logger.error
logger.warn
logger.info
logger.debug
logger.verbose
logger.silly
```

The prefix will be added to the logs as `@prefix`, for the NodeJS applications we are recommending to use `__filename`(global variable) as a prefix for easy debugging and finding something in the logs

### `setTransport`

This method allows you set function which will be called before logging something in the console.

## Created by

* [Evgeny Zaytsev](https://github.com/z4o4z)

## License

MIT
npm package: @monterourena/zeen
Description: The ExpressMongooseTS Boilerplate Generator is a versatile CLI tool designed to streamline the process of setting up boilerplate code, endpoints, and project structure for applications built using Express.js, Mongoose, and TypeScript. With a focus on deve
Author: monterourena
Latest version: 1.0.2

![ZeenBanner](https://github.com/monterourena/zeen/assets/117543842/7ae8345c-f3e1-409c-80f7-d1225e4d68ae)


Zeen is a versatile Command Line Interface (CLI) tool designed to streamline project setup and development workflows for Express, MongoDB, and TypeScript projects. With Zeen, you can effortlessly create custom endpoints, controllers, and models using TypeScript, simplifying your CLI development process.

## Table Of Contents
- [Table Of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
  - [Base Classes](#base-classes)
  - [Endpoints](#endpoints)
- [Contributing](#contributing)
- [License](#license)

## Features

- Generate boilerplate code for Express, MongoDB, and TypeScript projects.
- Create endpoints, controllers, services, models, etc.
- Streamline your project setup and development workflow.

## Installation

You can install Zeen globally using npm:

```bash
npm install -g  @monterourena/zeen
```

## Usage
### Base Classes
Endpoints generated by Zeen make use of a base router, base controller, base model, base service, and, base routes. All these base classes can be generated for your project using the following command:
```bash
zeen base
```
### Endpoints
Zeen allows you to quickly generate endpoints and other project components. To create a new endpoint, use the following command:
```bash
zeen endpoint <name>
```
This will generate the necessary files for a new endpoint with the specified name. Example:
```bash
zeen endpoint user 
```

This will generate:
- user.controller.ts
- user.d.ts
- user.model.ts
- user.router.ts
- user.service.ts 


## Contributing
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on GitHub.

## License
This project is licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
npm package: @monteway/codeshift
Description: Helpers for writing codemods
Author: Monterail
Latest version: 0.4.2

# @monteway/codeshift

Internal [jscodeshift](https://github.com/facebook/jscodeshift) helpers used in [@monteway/app](../app/readme.md) for easier codemod implementation.

## Install

```bash
npm i -D @monteway/codeshift
```

## Usage

### `appendImports`

Adds new import inside imports group. You can specify where the import should go, by selecting an existing import inside source file and set if the new one should go before of after it.

1. Let's have `index.tsx` file with following content:

   ```js
   import ReactDOM from 'react-dom';

   // some more content that is irrelevant
   ```

2. Now write a codemod file `codeshift.mjs` that will be run using jscodeshift. \
   In this example we want to add a React default import before `react-dom` import.

   ```js
   import { appendImports } from '@monteway/codeshift';

   export default function codemod(file, api, options) {
     const jscodeshift = api.jscodeshift;

     let source = jscodeshift(file.source);

     source = appendImports(
       jscodeshift,
       source,
       'BEFORE_FIRST',
       /^react-dom$/,
       `import React from 'react';`,
     );

     return source.toSource();
   }
   ```

3. The output of running `codeshift.mjs` for `index.tsx` content would be:

   ```diff
   + import React from 'react';
   import ReactDOM from 'react-dom';

   // some more content that is irrelevant
   ```

### `wrapDefaultExport`

Finds a default export and wraps it with a call experssion.

1. Let's have a `index.tsx` file with the following content:

   ```ts
   import React from 'react';

   function Component() {
     return <>Hello, world!</>;
   }

   export default Component;
   ```

2. Now write a codemod file `codeshift.mjs` that will be run using jscodeshift. \
   In this example we want to wrap the `Component` with `memo`.

   ```js
   import { wrapDefaultExport } from '@monteway/codeshift';

   export default function codemod(file, api, options) {
     const jscodeshift = api.jscodeshift;

     let source = jscodeshift(file.source);

     source = wrapDefaultExport(jscodeshift, source, 'memo');

     return source.toSource();
   }
   ```

3. The output of running `codeshift.mjs` for `index.tsx` content would be:

   ```diff
   import React from 'react';

   function Component() {
     return <>Hello, world!</>;
   }

   - export default Component;
   + export default memo(Component);
   ```

   > Notice that for this code to run we would need to add import for `memo`. We could solve it by using
   > `React.memo` instead of `memo`, since `React` is already imported, but right now,
   > the `wrapDefaultExport` does not accept anything other than identifier node,
   > so we could not use `React.memo`, since this a member experssion, not an identifier.
npm package: @monteway/eslint
Description: Full ESLint config for Monterail projects
Author: Monterail
Latest version: 0.4.2

# @monteway/eslint

Shareable ESLint configuration for Node or React projects. Provides out-of-the-box configuration for common rules we used in Monterail projects. Supports React, imports syntax, import aliases and prettier.

## Install

```bash
npm i -D eslint @monteway/eslint
```

## Usage

Simply create your ESLint config file with following content:

```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: require.resolve('@monteway/eslint/config'),
};
```

> If you have Next.js project, prefer using [`@monteway/eslint-next`](../eslint-next/) instead which extends also Next.js's core ESLint config.\
> Preferred way to add ESLint support is to use [`@monteway/app extend`](../app) command.
npm package: @monteway/eslint-next
Description: Full ESLint config for Monterail projects based on Next.js
Author: Monterail
Latest version: 0.4.2

# @monteway/eslint-next

Shareable ESLint configuration for Next.js projects. This config is built on top of [`@monteway/eslint`](../eslint/) and just adds support for Next.js rules offered by `eslint-config-next`.

## Install

```bash
npm i -D eslint @monteway/eslint-next
```

## Usage

Simply create your ESLint config file with following content:

```js
/** @type {import('eslint').Linter.Config} */
module.exports = {
  root: true,
  extends: require.resolve('@monteway/eslint-next/config'),
};
```

> Preferred way to add ESLint support is to use [`@monteway/app extend --template next`](../app) command.
npm package: @monteway/next
Description: Utilities for Monterail projects based on Next.js
Author: Monterail
Latest version: 0.4.2

# @monteway/next

Useful utilities for Next.js apps.\
Also a production-ready Dockerfile for Next.js projects.

## Install

```
npm i @moneway/next
```

## Usage

### `errorPropsResponse`

Return an object that is compatible with the result of `getServerSideProps` / `getStaticProps` and includes an internal property marking the response as having some error.

```tsx
import { errorPropsResponse } from '@monteway/next/error';
import type { GetServerSidePropsContext } from 'next';

export async function getServerSideProps(context: GetServerSidePropsContext) {
  try {
    // Pretend we have a call here to some API that can throw
    // an error when user has no access to the page.
  } catch {
    // This responds with HTTP 403 status
    // and returns
    //  {
    //    props: {
    //      error: 'You cannot access this page',
    //      __isErrorProps__: true
    //    },
    //  }
    return errorPropsResponse(context.res, {
      statusCode: 403,
      error: 'You cannot access this page',
    });
  }
}
```

### `isErrorProps`

Checks if the argument is from `errorPropsResponse`.

```ts
import { errorPropsResponse, isErrorProps } from '@monteway/next/error';

const response = errorPropsResponse(null, {
  statusCode: 403,
  error: 'You cannot access this page',
});

isErrorProps(response.props);
// true
```

## Docker

This package includes also a official Dockerfile for Next.js project which is production ready.\
We have extended it with some optional build arguments that can be used to extend the image.

| `--build-arg`            | Description                |
| ------------------------ | -------------------------- |
| `BEFORE_INSTALL_COMMAND` | Run before `npm install`   |
| `AFTER_INSTALL_COMMAND`  | Run after `npm install`    |
| `BEFORE_BUILD_COMMAND`   | Run before `npm run build` |
| `AFTER_BUILD_COMMAND`    | Run after `npm run build`  |

Example usage of the Dockerfile (make sure the Docker context is root of the Next.js app):

```bash
docker build \
  --build-arg BEFORE_INSTALL_COMMAND="exit 0" \
  --build-arg AFTER_INSTALL_COMMAND="exit 0" \
  --build-arg BEFORE_BUILD_COMMAND="exit 0" \
  --build-arg AFTER_BUILD_COMMAND="exit 0" \
  --tag ${IMAGE_TAG} \
  --file node_modules/@monteway/next/dockerfile .
```
npm package: @monteway/prettier
Description: Basic Prettier config for Monterail projects
Author: Monterail
Latest version: 0.4.2

# @monteway/prettier

Very basic configuration for Prettier.

## Install

```bash
npm i -D prettier @monteway/prettier
```

## Usage

Simply create your Prettier config file with following content:

```js
module.exports = require('@monteway/prettier/config');
```

## Defaults

This is the default configuration for Prettier.\
For the sake of consistency between projects it should not be changes or overwritten.

```js
{
  // Max line length is 100 characters.
  printWidth: 100,

  // Put semicolons always.
  semi: true,

  // Use single quotes.
  singleQuote: true,

  // Identation should be 2 spaces.
  tabWidth: 2,

  // Put commas whenever possible.
  trailingComma: 'all',
}

```
npm package: @monteway/scripts
Description: Useful development scripts for Monterail projects
Author: Monterail
Latest version: 0.4.2

# @monteway/scripts

Common command line scripts to enhance developer experience, optimize things in projects, etc.

## Install

```bash
npm i @monteway/scripts
```

## Usage

### `postinstall`

A script to be run after `npm install`.\
It does the following:

1. If no `.env` file is found but there is a sample file, like `.env.example`, it will create the missing `.env` file based on the example one. Recognized sample files are: `.env.example`, `.env.sample`, `.env-example`, `.example.env`.
2. If there is [lefthook](https://github.com/evilmartians/lefthook) config present, it will make sure to install git hooks from it.

```bash
npx @monteway/scripts postinstall
```

> Feel free to add more stuff to the postinstall script that you find might be usefull for many projects.
npm package: @monteway/typescript
Description: Different TypeScript configs for Monterail projects
Author: Monterail
Latest version: 0.4.2

# @monteway/typescript

Diffent TypeScript configs for multiple purposes.

## Install

```bash
npm i typescript @monteway/typescript
```

## Reference

| Config file                      | Purpose                                |
| -------------------------------- | -------------------------------------- |
| `tsconfig-base.json`             | Includes common compiler options       |
| `tsconfig-next-app.json`         | For Next.js projects                   |
| `tsconfig-node-app.json`         | For Node.js projects                   |
| `tsconfig-node-esm-library.json` | For libraries with (outputs ESM)       |
| `tsconfig-node-library.json`     | For libraries with (outputs CommonJS)  |
| `tsconfig-react-library.json`    | For React libraries (outputs CommonJS) |
| `tsconfig-remix-app.json`        | For Remix projects                     |

## Usage

Just create your TypeScript config file and extend chosen configuration.

```json
{
  "extends": "@monteway/typescript/tsconfig-node-esm-library.json",
  "compilerOptions": {
    "rootDir": "src",
    "outDir": "dist"
  },
  "include": [...],
  "exclude": [...]
}
```
npm package: @monteway/utils
Description: Common utilities for Monterail projects
Author: Monterail
Latest version: 0.4.2

# @monteway/utils

Tiny but useful utilities.

## Install

```bash
npm i @monteway/utils
```

## Usage

### `trimMultiline`

- Trims useless spaces from the beginning of each line.
- Removes empty new lines at the beginning and end of the input.
- Keeps the identation pattern.

#### Example

```ts
import { trimMultiline } from '@monteway/utils/format';

const code = `
  function foo() {
    return bar;
  }
`;

const output = trimMultiline(code);
```

- If we do `console.log(code)`, the result will be:

  ```
    function foo() {
      return bar;
    }
  ```

- If we do `console.log(output)`, the result will be different by trimming the trailing, useless spaces:

  ```
  function foo() {
    return bar;
  }
  ```

  > This shows, that `trimMultiline` acts a little bit like Prettier.

#### Options

As a second, optional arguments we might pass an object:

```ts
{
  // Make sure the miniam identation is this number of spaces.
  indentBy?: number;

  // Keep a single new line at the beginning of the output (since by default it's removed).
  startWithNewLine?: boolean;
}
```
npm package: @montferret/ferret-wasm
Description: Ferret compiler and runtime ported to WASM
Author: MontFerret Team
Latest version: 1.0.0

# ferret-wasm

Ferret compiler and runtime ported to WASM

[![npm version](https://badge.fury.io/js/%40montferret%2Fferret-wasm.svg)](https://badge.fury.io/js/%40montferret%2Fferret-wasm)
[![Build Status](https://secure.travis-ci.org/montferret/ferret-wasm.svg?branch=master)](http://travis-ci.org/montferret/ferret-wasm)

## Installation

```sh
npm install @montferret/ferret-wasm
```

## Limitations

-   Supports only static HTTP driver (Go WASM does not support WebSocket yet)

## Quick start

```javascript
const { create } = require('@montferret/ferret-wasm');

async function test() {
    const compiler = await create();

    const out = await compiler.exec(`
      FOR i IN 1..10
          RETURN i * 2
  `);

    console.log(out); // [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
}

test();
```

```javascript
const { create } = require('@montferret/ferret-wasm');

async function test() {
    const compiler = await create();

    const program = compiler.compile(`
      FOR i IN 1..10
          RETURN i * @factor
  `);

    const out1 = await program.run({ factor: 2 });

    console.log(out1); // [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]

    const out2 = await program.run({ factor: 3 });

    console.log(out2); // [3, 6, 9, 12, 15, 18, 21, 24, 27, 30]

    // Destroy when you are done with the program
    program.destroy();
}

test();
```

### Function registration

Sync functions

```javascript
const { create } = require('@montferret/ferret-wasm');

async function test() {
    const compiler = await create();
    compiler.register('MY_FUNC', (...args) => {
        return args.join('-');
    });

    const out = await compiler.exec(`
      RETURN MY_FUNC('foo', 'bar')
  `);

    console.log(out); // foo-bar
}

test();
```

Async functions

```javascript
const { create } = require('@montferret/ferret-wasm');

async function test() {
    const compiler = await create();
    compiler.register('MY_FUNC', (...args) => {
        return new Promise(resolve => {
            setTimeout(() => {
                resolve(args.join('-'));
            }, 10);
        });
    });

    const out = await compiler.exec(`
      RETURN MY_FUNC('foo', 'bar')
  `);

    console.log(out); // foo-bar
}

test();
```
npm package: @montflow/core
Description: A collection of typescript utilities
Author: Daniel Montilla
Latest version: 3.0.0-alpha.9

# @montflow/core ⚙️

## Install

```
npm i @montflow/core
```

```
pnpm add @montflow/core
```

## Features

- 🚀 **Powerful**. Provides a set of utilities to enhance your development workflow.
- 🎈 **Lightweight**. Minimal footprint for maximum performance.
- 🌳 **Treeshakable**. Import only what you need.
- 🛠 **Composable**. Build complex logic with simple primitives.
- 📝 **DX**. Top-in-class support with TypeScript for an enhanced developer experience.

## License

MIT © [montflow](https://montflow.dev)
npm package: @montflow/stlx
Description: tailwind-merge + clsx wrapper
Author: Daniel Montilla
Latest version: 0.0.1

# @montflow/stlx 🎨

The fastest way to conditionally merge Tailwind CSS classes.

## Install

```bash
npm i @montflow/stlx
```

```bash
pnpm add @montflow/stlx
```

## Usage

```typescript
import { stlx } from "@montflow/stlx";

const classes = stlx("text-sm", "text-red-500", true && "font-bold", false && "hidden");
// Result: "text-sm text-red-500 font-bold"
```

Refer to [clxs](https://github.com/lukeed/clsx#readme) or [tailwind-merge](https://github.com/dcastil/tailwind-merge#readme) documentation for more.

## License

MIT © [montflow](https://montflow.dev)
npm package: @montfort_npm/common
Description: Based on Excalidraw common functions, constants, etc.
Latest version: 2.1.0

# @montfort_npm/common

## Install

```bash
npm install @montfort_npm/common
```

If you prefer Yarn over npm, use this command to install the Excalidraw utils package:

```bash
yarn add @montfort_npm/common
```

With PNPM, similarly install the package with this command:

```bash
pnpm add @montfort_npm/common
```
npm package: @montfort_npm/element
Description: Based on Excalidraw elements-related logic
Latest version: 2.1.3

# @montfort_npm/element

## Install

```bash
npm install @montfort_npm/element
```

If you prefer Yarn over npm, use this command to install the Excalidraw utils package:

```bash
yarn add @montfort_npm/element
```

With PNPM, similarly install the package with this command:

```bash
pnpm add @montfort_npm/element
```
npm package: @montfort_npm/excalidraw
Description: Based on Excalidraw as a React component
Latest version: 5.1.4

# Excalidraw

**Excalidraw** is exported as a component to be directly embedded in your project.

## Installation

Use `npm` or `yarn` to install the package.

```bash
npm install react react-dom @montfort_npm/excalidraw
# or
yarn add react react-dom @montfort_npm/excalidraw
```

> **Note**: If you don't want to wait for the next stable release and try out the unreleased changes, use `@montfort_npm/excalidraw@next`.

#### Self-hosting fonts

By default, Excalidraw will try to download all the used fonts from the [CDN](https://esm.run/@montfort_npm/excalidraw/dist/prod).

For self-hosting purposes, you'll have to copy the content of the folder `node_modules/@montfort_npm/excalidraw/dist/prod/fonts` to the path where your assets should be served from (i.e. `public/` directory in your project). In that case, you should also set `window.EXCALIDRAW_ASSET_PATH` to the very same path, i.e. `/` in case it's in the root:

```js
<script>window.EXCALIDRAW_ASSET_PATH = "/";</script>
```

### Dimensions of Excalidraw

Excalidraw takes _100%_ of `width` and `height` of the containing block so make sure the container in which you render Excalidraw has non zero dimensions.

## Demo

Go to [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example.

## Integration

Head over to the [docs](https://docs.excalidraw.com/docs/@montfort_npm/excalidraw/integration).

## API

Head over to the [docs](https://docs.excalidraw.com/docs/@montfort_npm/excalidraw/api).

## Contributing

Head over to the [docs](https://docs.excalidraw.com/docs/@montfort_npm/excalidraw/contributing).
npm package: @montfort_npm/math
Description: Based on Excalidraw math functions
Latest version: 2.1.1

# @montfort_npm/math

## Install

```bash
npm install @montfort_npm/math
```

If you prefer Yarn over npm, use this command to install the Excalidraw utils package:

```bash
yarn add @montfort_npm/math
```

With PNPM, similarly install the package with this command:

```bash
pnpm add @montfort_npm/math
```
npm package: @montfort_npm/utils
Description: Excalidraw utility functions
Latest version: 2.1.1

# @montfort_npm/utils

## Install

```bash
npm install @montfort_npm/utils
```

If you prefer Yarn over npm, use this command to install the Excalidraw utils package:

```bash
yarn add @montfort_npm/utils
```

## API

### `serializeAsJSON`

See [`serializeAsJSON`](https://github.com/excalidraw/excalidraw/blob/master/src/packages/excalidraw/README.md#serializeAsJSON) for API and description.

### `exportToBlob` (async)

Export an Excalidraw diagram to a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob).

### `exportToSvg`

Export an Excalidraw diagram to a [SVGElement](https://developer.mozilla.org/en-US/docs/Web/API/SVGElement).

## Usage

Excalidraw utils is published as a UMD (Universal Module Definition). If you are using a module bundler (for instance, Webpack), you can import it as an ES6 module:

```js
import { exportToSvg, exportToBlob } from "@montfort_npm/utils";
```

To use it in a browser directly:

```html
<script src="https://unpkg.com/@montfort_npm/utils@0.1.0/dist/excalidraw-utils.min.js"></script>
<script>
  // ExcalidrawUtils is a global variable defined by excalidraw.min.js
  const { exportToSvg, exportToBlob } = ExcalidrawUtils;
</script>
```

Here's the `exportToBlob` and `exportToSvg` functions in action:

```js
const excalidrawDiagram = {
  type: "excalidraw",
  version: 2,
  source: "https://excalidraw.com",
  elements: [
    {
      id: "vWrqOAfkind2qcm7LDAGZ",
      type: "ellipse",
      x: 414,
      y: 237,
      width: 214,
      height: 214,
      angle: 0,
      strokeColor: "#000000",
      backgroundColor: "#15aabf",
      fillStyle: "hachure",
      strokeWidth: 1,
      strokeStyle: "solid",
      roughness: 1,
      opacity: 100,
      groupIds: [],
      roundness: null,
      seed: 1041657908,
      version: 120,
      versionNonce: 1188004276,
      isDeleted: false,
      boundElementIds: null,
    },
  ],
  appState: {
    viewBackgroundColor: "#ffffff",
    gridSize: null,
  },
};

// Export the Excalidraw diagram as SVG string
const svg = exportToSvg(excalidrawDiagram);
console.log(svg.outerHTML);

// Export the Excalidraw diagram as PNG Blob URL
(async () => {
  const blob = await exportToBlob({
    ...excalidrawDiagram,
    mimeType: "image/png",
  });

  const urlCreator = window.URL || window.webkitURL;
  console.log(urlCreator.createObjectURL(blob));
})();
```
npm package: @montfort_npm/wb_dependencies_base
Description: Unified Excalidraw package with all components and utilities
Latest version: 2.0.1

# Excalidraw Unified

A unified package containing all Excalidraw components and utilities, built on top of the great [Excalidraw](https://github.com/excalidraw/excalidraw) library.

## Installation

```bash
npm install @montfort_npm/excalidraw-unified
```

## Usage

```typescript
import { Excalidraw, exportToCanvas, isElementInsideBBox } from '@montfort_npm/excalidraw-unified';

// Use Excalidraw component
<Excalidraw />

// Use utility functions
const isInside = isElementInsideBBox(element, bbox);
const canvas = exportToCanvas(elements);
```

## Features

- Complete Excalidraw drawing component
- All utility functions and types
- Element manipulation helpers
- Math utilities for geometric operations
- Bounds checking and collision detection
- Export capabilities

## Credits

This package is built on top of the excellent [Excalidraw](https://github.com/excalidraw/excalidraw) library. All credit goes to the Excalidraw team for creating this amazing drawing tool.

## License

MIT
npm package: @monti-apm/mongo-sharded-cluster
Description: Shard MongoDB in the app layer and build a MongoDB cluster
Author: Arunoda Susiripala
Latest version: 4.0.0

## Mongo Sharded Cluster

A simple way to shard MongoDB on the app layer. 

With this approach, we have a set of replica sets. Then we can select a shard for our data based on free disk space on the DB.

> For this, you need to run identical clusters (with the same size of disk space and the same storage engine)


### Usage

Install it first:

```
npm i mongo-sharded-cluster
```

Using it

```js
var MongoCluster = require('mongo-sharded-cluster');
var MongoClient = require('mongodb').MongoClient;
var async = require('async');

var myCluster = new MongoCluster();

var replSetUrls = [
    {name: "one", url: "mongodb://localhost/one"},
    {name: "two", url: "mongodb://localhost/two"},
];
async.each(replSetUrls, function(replSetInfo, done) {
    MongoClient.connect(replSetInfo.url, function(err, db) {
        if(db) {
            myCluster.add(replSetInfo.name, db);
        }
        done(err);
    });
}, function(err) {
    if(err) {
        throw err;
    }

    myCluster.startDbSizeLookup(function() {
        // Pick a shard
        var shardName = myCluster.pickShard(); 
        // Then you can save this shardName in where you need.
        
        // Get the connection for the shard
        var conn = myCluster.getConnection(shardName);
    });
});
```


### Initialize a Cluster With Environment Variables

You can use following helper method to initialize a cluster without hassle.

First make sure you have exports following env variables.

```
export MONGO_SHARD_URL_one=mongodb://localhost/one
export MONGO_SHARD_URL_two=mongodb://localhost/two
```

Then you can get initialize a cluster like this:

```js
var MongoCluster = require('mongo-sharded-cluster');
MongoCluster.initFromEnv(function(err, cluster) {
    if(err) {
        throw err;
    }

    // do anything with the cluster
});
```