open-index/open-npm huggingface dataset:
npm package: @mongodb-js/get-os-info
Description: Get os info for telemetry
Author: MongoDB Inc
Latest version: 0.6.7

# get-os-info

Returns info about the host os

```js
const info = await getOsInfo();
```

Example output:

```js
{
  os_type: 'Darwin',
  os_version: 'Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64',
  os_release: '21.4.0',
  os_arch: 'x64',
  // only on linux:
  os_linux_dist: 'ubuntu' ,
  os_linux_release: '20.04',
}
```
npm package: @mongodb-js/hadron-app-registry-redux-middleware
Description: Redux middleware for interfacing with the Hadron App Registry
Author: Matt Fairbrass
Latest version: 1.0.1

# hadron-app-registry-redux-middleware
[![][travis_img]][travis_url]

[Redux](https://redux.js.org) middleware which wraps the [Hadron App Registry](https://github.com/mongodb-js/hadron-app-registry) to facilitate the integration between Hadron App components which may use different state or store implementations (eg: [Reflux](https://github.com/reflux/refluxjs), [MobX](https://github.com/mobxjs/mobx)).

The middleware listens to relevant Hadron App Registry events and dispatches them as Redux actions. It is also able to intercept relevant dispatched Redux actions and emit them as events in the Hadron App Registry.

## Getting Started

```
$ npm install --save @mongodb-js/hadron-app-registry-redux-middleware
```

or

```
$ yarn add @mongodb-js/hadron-app-registry-redux-middleware
```

Alternatively, you may use the provided UMD builds directly in the `<script>` tag of an HTML page.

## Usage Example

Create and apply the middleware to the Redux store, passing an instance of the `hadron-app-registry` as the first argument, along with any mappings for `eventsToActions` and `actionsToEvents`.

```javascript
import { createStore, applyMiddleware } from 'redux';
import AppRegistry from 'hadron-app-registry';
import hadronAppRegistryReduxMiddleware from '@mongodb-js/hadron-app-registry-redux-middleware';
import reducers from './reducers';

const appRegistry = new AppRegistry();

// map appRegistry event names (key) to Redux action types (value)
const eventsToActions = {
  'foo': 'BAR'
};

// map Redux action types (key) to appRegistry event names (value)
const actionsToEvents = {
  'FIZZ': 'buzz'
};

let store = createStore(
  reducers,
  applyMiddleware(
    hadronAppRegistryReduxMiddleware(
      appRegistry,
      eventsToActions,
      actionsToEvents
    )
  )
);
```

## Demo Example

This project also includes an example demonstrating the middleware in action:

![][demo_img]

To run the demo, clone this project and execute the following:

```bash
$: cd ./examples/react
$: npm install
$: npm start
```

## Change Log

This project adheres to [Semantic Versioning](http://semver.org/).
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/reactjs/redux/releases) page.

## License

Apache 2.0

[travis_img]: https://img.shields.io/travis/mongodb-js/hadron-app-registry-redux-middleware.svg?style=flat-square
[travis_url]: https://travis-ci.org/mongodb-js/hadron-app-registry-redux-middleware
[demo_img]: demo.gif
npm package: @mongodb-js/mongodb-downloader
Description: Downloads MongoDB server artifacts
Author: MongoDB Inc
Latest version: 1.1.9

## mongodb-downloader

A simple library to download MongoDB binaries for different platforms and versions.

### Migrating from v0.5 to v0.6+

In v0.6.x, the library introduced lockfiles to prevent parallel downloads of the same MongoDB binary. It also changed the arguments for the `downloadMongoDb` and `downloadMongoDbWithVersionInfo` functions, introducing a new `useLockfile` field and using a single options object instead of separate parameters for different options. It is recommended to enable lockfiles to prevent redundant downloads unless you have a specific reason not to.

```ts
// Before (v0.5.x)
downloadMongoDb('/tmp/directory', '4.4.6', {
  platform: 'linux',
  arch: 'x64',
});

downloadMongoDbWithVersionInfo('/tmp/directory', '4.4.6', {
  arch: 'x64',
});

// After (v0.6.x)
downloadMongoDb({
  directory: '/tmp/directory',
  version: '4.4.6',
  useLockfile: true, // New, required field.
  downloadOptions: {
    platform: 'linux',
    arch: 'x64',
  },
});

downloadMongoDbWithVersionInfo({
  directory: '/tmp/directory',
  version: '4.4.6',
  useLockfile: true, // New, required field.
  downloadOptions: {
    arch: 'x64',
  },
});
```
npm package: @mongodb-js/mongodb-zod
Description: MongoDB zod plugin for the Node.js driver
Author: MongoDB Inc
Latest version: 0.1.0

# @mongodb-js/mongodb-zod

zod + mongodb = <3

```js
import { withSchema } from '@mongodb-js/mongodb-zod';

const client = await MongoClient.connect(process.env.MONGODB_URI);
const coll = withSchema(
  client.db('test').collection('users'),
  z.object({
    _id: z.string(),
    name: z.string(),
    age: z.number().min(0),
  }),
);

await coll.installSchemaValidation();
```

Experimental – external contributions welcome!

## License

Apache 2.0
npm package: @mongodb-js/oidc-plugin
Description: MongoDB OIDC plugin for the Node.js driver
Author: MongoDB Inc
Latest version: 2.0.8

# @mongodb-js/oidc-plugin

A plugin for the [MongoDB Node.js driver][] to support human/browser-based
OIDC authentication flows.

OIDC support is a preview feature of MongoDB and not currently recommended for
production usage.

## Example usage

```ts
import { MongoClient } from 'mongodb';
import { createMongoDBOIDCPlugin } from '@mongodb-js/oidc-plugin';

// All config options are optional.
const config = {
  openBrowser: {
    command: 'open -a "Firefox"',
  },
  // allowedFlows: ['auth-code', 'device-auth'], // if Device Auth Grant flow is required
};

const client = await MongoClient.connect(
  'mongodb+srv://.../?authMechanism=MONGODB-OIDC',
  {
    ...createMongoDBOIDCPlugin(config).mongoClientOptions,
  }
);

// ...
```

See the TypeScript annotations for more API details.

[mongodb node.js driver]: https://github.com/mongodb/node-mongodb-native
npm package: @mongodb-js/query-parser
Description: Parse MongoDB queries
Author: MongoDB Inc
Latest version: 4.0.1

# mongodb-query-parser [![Check and Test][workflow_img]][workflow_url] [![npm][npm_img]][npm_url]

> Safe parsing and validation for MongoDB queries (filters), projections, and more.

## Example

Turn some JS code as a string into a real JS object safely and with no bson type loss:

```javascript
require('mongodb-query-parser')('{_id: ObjectId("58c33a794d08b991e3648fd2")}');
// >>> {_id: ObjectId('58c33a794d08b991e3648fd2'x)}
```

### Usage with codemirror

```javascript
var parser = require('mongodb-query-parser');
var query = '{_id: ObjectId("58c33a794d08b991e3648fd2")}';
// What is this highlighting/language mode for this string?
parser.detect(query);
// >>> `javascript`

var queryAsJSON = '{"_id":{"$oid":"58c33a794d08b991e3648fd2"}}';
// What is this highlighting/language mode for this string?
parser.detect(queryAsJSON);
// >>> `json`

// Turn it into a JS string that looks pretty in codemirror:
parser.toJavascriptString(parse(query));
// >>> '{_id:ObjectId(\'58c33a794d08b991e3648fd2\')}'
```

### Extended JSON Support

```javascript
var bson = require('bson');
var parser = require('mongodb-query-parser');
var queryAsAnObjectWithTypes = parser.parseFilter(query);

// Use extended json to prove types are intact
bson.EJSON.stringify(queryAsAnObjectWithTypes);
// >>> '{"_id":{"$oid":"58c33a794d08b991e3648fd2"}}'

var queryAsJSON = '{"_id":{"$oid":"58c33a794d08b991e3648fd2"}}';
parser.detect(queryAsJSON);
// >>> `json`
```

## Migrations

We aim to not have any API breaking changes in this library as we consider it stable, but breakages may occur whenever we upgrade a core dependency or perform a major refactor.

We have a [migration guide](MIGRATION.md) which covers what to look out for between releases.

## Related

- [`mongodb-stage-validator`](https://github.com/mongodb-js/stage-validator) Parse and validate MongoDB Aggregation Pipeline stages.
- [`@mongodb-js/compass-query-bar`](https://github.com/mongodb-js/compass-query-bar) Compass UI Plugin that uses `mongodb-query-parser` for validation.

## License

Apache 2.0

[workflow_img]: https://github.com/mongodb-js/query-parser/workflows/Check%20and%20Test/badge.svg?event=push
[workflow_url]: https://github.com/mongodb-js/query-parser/actions?query=workflow%3A%22Check+and+Test%22
[npm_img]: https://img.shields.io/npm/v/mongodb-query-parser.svg
[npm_url]: https://npmjs.org/package/mongodb-query-parser