open-index/open-npm huggingface dataset:
npm package: @searchmoe/react-native-grpc
Description: gRPC for react-native
Author: Mitch528
Latest version: 1.0.0

# react-native-grpc

gRPC for react-native

## Installation

```sh
npm install @searchmoe/react-native-grpc
```

## Usage

```ts
import { GrpcClient, GrpcMetadata } from '@searchmoe/react-native-grpc';

GrpcClient.setHost('example.com');

// Bring your own protobuf library
// This example uses https://github.com/timostamm/protobuf-ts

const request = ExampleRequest.create({
  message: 'Hello World!',
});

const data: Uint8Array = ExampleRequest.toBinary(request);
const headers: GrpcMetadata = {};

const { response } = await GrpcClient.unaryCall(
  '/example.grpc.service.Examples/SendExampleMessage',
  data,
  headers
);

const responseMessage = ExampleMessage.fromBinary(response);
```

See `examples` project for more advanced usage.

## Limitations

This library currently only supports unary and server-side streaming type RPC calls. PRs are welcome.

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT
npm package: @searchone/autumn-js
Description: Autumn JS Library
Author: John Yeo
Latest version: 0.1.52

# Autumn JS Library

`autumn-js` is a JavaScript/TypeScript library for interacting with the Autumn pricing and billing platform. This package provides both a server-side SDK for the Autumn API and a React package for client-side implementation.

## Installation

```bash
npm install autumn-js
```

## Docs
To learn how to use `autumn-js`, visit our documentation [here](https://docs.useautumn.com)
npm package: @searchspring/commitlint-config
Description: For clean commits!
Author: Eric Hacke
Latest version: 1.0.0

# commitlint-config
For clean commits!

```bash
npm i -D @searchspring/commitlint-config
```

Basically just adds the "wip" label.

The full set of commit labels is:

```json
[
    "build", 
    "ci", 
    "chore", 
    "docs", 
    "feat", 
    "fix", 
    "merge", 
    "perf", 
    "refactor", 
    "revert", 
    "style", 
    "test", 
    "wip"
]
```

Check out commitlint info here: https://github.com/conventional-changelog/commitlint
npm package: @searchspring/eslint-config
Description: Our style
Author: Eric Hacke
Latest version: 1.0.8-0

# eslint-config

This is based on the AirBnB style guide, but includes a number of additional plugins and some custom rules for our preferences.

Checkout the `index.js` for the details.

### Plugins

- AirBnB: https://github.com/airbnb/javascript
- Import: https://github.com/benmosher/eslint-plugin-import
- ESLint Comments: https://github.com/mysticatea/eslint-plugin-eslint-comments
- SonarJS: https://github.com/SonarSource/eslint-plugin-sonarjs
- Promise: https://github.com/xjamundx/eslint-plugin-promise
- Prettier-ESLint compatibility: https://github.com/prettier/eslint-config-prettier
- Unicorn: https://github.com/sindresorhus/eslint-plugin-unicorn

Occasionally look [here](https://github.com/dustinspecker/awesome-eslint) for new good stuff.

## Install

To install just the config, use the line below.

```bash
npm i -D @searchspring/eslint-config
```

It's recommended to also install the Searchspring prettier config:

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

In order to install all the related dependencies and a typical configuration for a JS project, also run the following:

```bash
npm i -D eslint husky lint-staged prettier fixpack
```

Then update your `package.json` with the following:

```json5
{
	husky: {
		hooks: {
			// Runs staged files for a commit through the scripts below
			'pre-commit': 'lint-staged',
		},
	},
	// Scripts for staged files
	'lint-staged': {
		'./package.json': ['fixpack', 'prettier --write'],
		'*.{js,ts}': ['prettier --write', 'eslint --fix'],
	},
	scripts: {
		format: 'prettier --write "**/*.{js,ts,json}"',
		lint: 'eslint --fix "**/*.{js,ts}"',
		// Important to run the fixpack before format, as format will fix the indentation
		style: 'fixpack && npm run format && npm run lint',
	},
}
```

### Additional config if you are using Mocha
- Mocha: https://github.com/lo1tuma/eslint-plugin-mocha

Update your eslint configuration with following:
```diff
	env: {
		...
+		mocha: true,
	},
	extends: [
		...
+		'plugin:mocha/recommended',
	]
+	plugins: [..., 'mocha'],
	rules: {
		...
+		'mocha/handle-done-callback': 'error',
+		'mocha/max-top-level-suites': 'off',
+		'mocha/no-exclusive-tests': 'error',
+		'mocha/no-global-tests': 'error',
+		'mocha/no-hooks-for-single-case': 'off',
+		'mocha/no-identical-title': 'error',
+		'mocha/no-mocha-arrows': 'off',
+		'mocha/no-nested-tests': 'error',
+		'mocha/no-pending-tests': 'error',
+		'mocha/no-return-and-callback': 'error',
+		'mocha/no-sibling-hooks': 'error',
	}
npm package: @searchspring/snap-event-manager
Description: Snap Event Manager
Author: Searchspring
Latest version: 0.76.1

# Snap Event Manager


The Snap Event Manager is available on each controller via `controller.eventManager` and is used to create events and attach middleware to them. Events are recommended to be configured via [Configuration Middleware](https://github.com/searchspring/snap/tree/main/docs/REFERENCE_CONFIGURATION_MIDDLEWARE.md) to hook into controller events at critical times in the life cycle. It also allows for custom events to be used throughout your implementation.


## Controller usage
Snap Event Manager is a dependency of Snap Controller and it is recommended to use methods of the controller to attach events to the EventManager. Additionally, different events exist for the different controllers - see the Controller documentation for more details.

## Standalone usage
### `on` method
Used to attach middleware to an event. If the event name previously had middleware attached, it will add to the middleware stack.

```js
controller.eventManager.on('interestingEvent', async (eventData, next) => {
	// do something with the eventData

	// pass control to the next middleware attached to the event
	await next();

	// do something after other middleware has fired
});
```

If a middleware returns `false` the entire middleware flow is interrupted and any remaining middleware is not executed.

### `fire` method
Invoke custom event. Data passed into the second parameter gets handed off to the middleware attached with the `on` method.

```js
controller.eventManager.fire('interestingEvent', { data: { some: 'string' } });
```

## Middleware
Middleware provide a way for mutating or modifying the data passed in during the `fire` method.

### Execution order
The first middleware attached with the `on` method is the first to execute. When calling `await next()`, control flows to the next attached middleware. This happens until the final middleware has been called after which control flows back up to the first middleware attached. The first middleware gets the first, and last opportunity to modify the data.

### Order Flow Example

```js
controller.eventManager.on('interestingEvent', async (data, next) => {
	console.log('first middleware start');
	await next();
	console.log('first middleware end');
});

controller.eventManager.on('interestingEvent', async (data, next) => {
	console.log('second middleware start');
	await next();
	console.log('second middleware end');
});

controller.eventManager.on('interestingEvent', async (data, next) => {
	console.log('third middleware start');
	await next();
	console.log('third middleware end');
});

controller.eventManager.fire('interestingEvent', { data: { some: 'string' } } );

```

After firing the `interestingEvent` event, the following would be displayed in the console:
```text
first middleware start
second middleware start
third middleware start
third middleware end
second middleware end
first middleware end
```
npm package: @searchspring/snap-platforms
Description: Snap Platforms Library
Author: Searchspring
Latest version: 0.76.1

# Snap Platforms


Snap Platforms contains functionality that makes working with various shopping platforms easier. Several platforms have standardized APIs that can be leveraged for things like adding products to the cart. The most commonly used platforms are currently supported with a standard `addToCart` function. This function can be used within Snap projects. Each platform may also support other functionality, checkout the documentation for each platform to find out more.


[Shopify](https://searchspring.github.io/snap/reference-platforms-shopify)

[BigCommerce](https://searchspring.github.io/snap/reference-platforms-bigcommerce)

[Magento2](https://searchspring.github.io/snap/reference-platforms-magento2)
npm package: @searchspring/snap-profiler
Description: Snap Profiler
Author: Searchspring
Latest version: 0.76.1

# Snap Profiler


Snap Profiler is a utility available on each controller via `controller.profiler` for recording how long something takes to complete. `Profiler` is used in finding API response, component rendering and Middleware execution times.


## `setNamespace` method
Programmatically set the namespace after construction.

```js
controller.profiler.setNamespace('namespace');
```

## `create` method
Create a new profile.

```js
const searchProfile = controller.profiler.create({ 
	type: 'event', 
	name: 'search', 
	context: params // any additional context
});
```

## `start` method

This will start the profiler timer.

```js
searchProfile.start();
```

## `stop` method
This will stop the profiler timer.

```js
searchProfile.stop();
```

## `namespace` property
Profile namespace that was set using the `Profiler` constructor or the `setNamespace` method.

```js
console.log(`namespace: ${searchProfile.namespace}`);
```

## `type` property
Profile type that was set in the `create` method `ProfileDetails` parameters.

```js
console.log(`type: ${searchProfile.type}`);
```

## `name` property
Profile name that was set in the `create` method `ProfileDetails` parameters.

```js
console.log(`name: ${searchProfile.name}`);
```

## `context` property
Profile context that was set in the `create` method `ProfileDetails` parameters. The context is used to provide additional details regarding the profile. A search profile would likely contain the request parameters among other things.

```js
console.log(`context: ${searchProfile.context}`);
```

## `status` property
Profile status. The default value is `pending`.

The value will change to `started` when the `start` method is invoked and to `finished` when the `stop` method is invoked.

```js
console.log(`context: ${searchProfile.status}`);
```

## `time` property
Profile time object is of type `ProfileTime`:

```js
type ProfileTime = {
	date: number;
	begin: number;
	end: number;
	run: number;
};
```

`ProfileTime.date` - set to `Date.now()` when `start` method is invoked.

`ProfileTime.begin` - set to `window.performance.now()` when `start` method is invoked.

`ProfileTime.end` - set to `window.performance.now()` when `stop` method is invoked.

`ProfileTime.run` - set to the total running time in milliseconds between when the `start` and `stop` methods have been invoked.


## Logging profiles
It is recommended to use the [Snap Logger's `profile`](https://searchspring.github.io/snap/reference-logger#profile-method) method to log Snap Profiles as it provides a clean output for easy parsing.
npm package: @searchspring/snap-store-mobx
Description: Snap MobX Store
Author: Searchspring
Latest version: 0.76.1

# Snap MobX Store

Management of Snap state using Mobx.

Although `@searchspring/snap-store-mobx` is published as a standalone package, it is not intended to be used directly. Internally it is a dependency of the `@searchspring/snap-preact` package. 

Each controller will have a store as a property. For example, the `SearchController` will have a `store` property that is an instance of the `SearchStore`.

See more information on the available stores below:
- [AbstractStore](https://searchspring.github.io/snap/reference-store-abstract)
- [SearchStore](https://searchspring.github.io/snap/reference-store-search)
- [AutocompleteStore](https://searchspring.github.io/snap/reference-store-autocomplete)
- [RecommendationStore](https://searchspring.github.io/snap/reference-store-recommendation)
- [FinderStore](https://searchspring.github.io/snap/reference-store-finder)
- [StorageStore](https://searchspring.github.io/snap/reference-store-storage)
- [MetaStore](https://searchspring.github.io/snap/reference-store-meta)
- [CartStore](https://searchspring.github.io/snap/reference-store-cart)
npm package: @searchspring/snap-toolbox
Description: Snap Toolbox
Author: Searchspring
Latest version: 0.76.1

# Snap Toolbox


A collection of utility tools such as DOM targeting, currency formatting & browser feature flags.

## Installation

```bash
npm install --save @searchspring/snap-toolbox
```


## Import
```js
import { 
    filters, 
    DomTargeter, 
    getFlags, 
    featureFlags, 
    cookies, 
    url,
    charsParams,
    until,
} from '@searchspring/snap-toolbox';
```
npm package: @searchspring/snap-tracker
Description: Snap Tracker
Author: Searchspring
Latest version: 0.76.1

# Snap Tracker

The Snap Tracker is a core service available on each controller via `controller.tracker`. It is responsible for sending beacon events. Its class directly extends the [beacon.js](https://github.com/athoscommerce/beacon.js) `Beacon` class, therefore all methods and properties of the Beacon class are available on the Tracker class.


## Snap Integration Usage
See [Integration Tracking](https://github.com/searchspring/snap/tree/main/docs/SNAP_TRACKING.md) for how and where to implement tracking events.

## `events` methods
See [beacon.js Tracking Events](https://github.com/athoscommerce/beacon.js?tab=readme-ov-file#tracking-events) for a list of available events.
npm package: @searchspring/snapi-oas
Description: Snap OpenAPI Specification
Author: Searchspring
Latest version: 0.1.46

# Snap API OpenAPI Specification v0.1.46

https://searchspring.github.io/snapi-oas/  

:warning: **WARNING!!!** :warning:
### This API is currently in testing and not yet ready for production usage.

:warning: **WARNING!!!** :warning:
### This repo is auto generated - do not commit directly. Instead make changes to the generator repo.
https://github.com/searchspring/snap-generator-openapi