open-index/open-npm huggingface dataset:
npm package: @rami-majdoub/hardhat-interact
Description: Hardhat TypeScript plugin to interact with smart contracts
Author: Rami Majdoub
Latest version: 0.0.1

# hardhat-interact

_Call functions of smart contracts with no code_

## What

This plugin will help you avoid writing boilerplate code that call smart contracts functions.

## Installation

```bash
npm install @rami-majdoub/hardhat-interact
```

Import the plugin in your `hardhat.config.js`:

```js
require("@rami-majdoub/hardhat-interact");
```

Or if you are using TypeScript, in your `hardhat.config.ts`:

```ts
import "@rami-majdoub/hardhat-interact";
```


## Required plugins

- [@nomiclabs/hardhat-web3](https://github.com/nomiclabs/hardhat/tree/master/packages/hardhat-web3)

## Tasks

This plugin adds the _interacat_ task to Hardhat:

```
Usage: hardhat [GLOBAL OPTIONS] interact [--account-id <INT>] [--contract-address <STRING>]

OPTIONS:

  --account-id      	Id of the account to connect with, default: Account #0 (default: 0)
  --contract-address	Address of the contract 

interact: Calls a function of a contract

For global options help run: hardhat help
```
npm package: @ramielcreations/coerce
Description: Coerce and validate your data
Author: Fabrizio Ruggeri
Latest version: 0.1.2

# Coerce

[![CircleCI](https://circleci.com/gh/ramiel/coerce.svg?style=svg)](https://circleci.com/gh/ramiel/coerce)

Coerce is a functional library that let you transform an input value into a fixed type and run validations on it.

This library aims to be as lean as possible so the minimal amount of code is run. If, for example, a validation fails, all the other validation functions are not run. More on this later.

## Install

`npm install --save @ramielcreations/coerce`

## Transform into type - coercing

Usually when you receive a value from an http request, this value is a string. Your library expects a number and so you want to cast your data before using it. But casting values in javascript can lead to some weird situation. This may be one case where you want to use a coercer.

```js
const coerce = require('@ramielcreations/coerce');

const onError = () => new Error('Invalid value');
const myCoercer = coerce(onError);
const age = myCoercer(req.age).toInt().value();
```

As you can see we built a coercer passing a function to say what to do in case of error (in this case to return an error). Then we used the `toInt` method to ensure the age of the user is an integer. So, if the request contains the value `"25"` this is transformed to `25`, a number.

As you can see we built the coercer before using it. The signature of the `coerce` function is

`coerce :: Function -> a -> {value, validate}`

but any function in coerce is curried. In this case we took advantage of the currying and we wrote the call in two step, but this is equivalent

```js
const onError = () => new Error('Invalid value');
const age = coerce(onError, req.age).toInt().value();
```

## Validation

When you coerce a value, the library returns you an object with two methods: `value`, which return the casted value and `validate` which let you apply a series of validators.
A validator is simply a function that returns a boolean and some basic validators are provided.

```js
const coerce = require('@ramielcreations/coerce');
const lessThan = require('coerce/validators/numbers/lessThan');

const onError = () => new Error('Invalid value');
const myCoercer = coerce(onError);
const age = myCoercer(req.age)
  .toInt()
  .validate(
    lessThan(80),
    x => x > 18
  )
  .value();
```

In this case the value is validated and it's checked that it's minor then 80 and more than 18. A `moreThan` validator exists, but here the function is implemented to show you can use any function to validate

## Don't waste my time

The library uses internally a `Maybe` wrapper for the value, so no function is run if any of the previous fails

```js
const value = 100;
const angle = coerce(() => 0, value)
  .toFloat()
  .validate(
    multipleOf(90),
    x => {
      console.log('This is not called because the previous validation fails');
      return x > 20;
    }
  )
  .value();

// angle will be 0 and the second validation function won't be called
```
npm package: @ramielcreations/rgbaster
Description: A dead simple javascript library for extracting the dominant color(s) from an image.
Author: Brian Gonzalez
Latest version: 2.1.1

![artboard](https://user-images.githubusercontent.com/659829/49244473-bd4ed580-f3c4-11e8-8bf2-498585148910.jpg)

A dead simple, zero-dependency, promise-based javascript library for extracting the dominant color(s) from an image (in the browser).

[![npm version](http://img.shields.io/npm/v/rgbaster.js.svg?style=flat)](https://npmjs.org/package/rgbaster.js "View this project on npm")


> 👉 Version 2 was written from the ground up with a clean and modern API, a robust test suite, and is fully written in Typescript.

## Installation

```
npm install --save rgbaster
```

## Usage

This library exports a default function which returns a promise resolving to a sorted array with
the most dominant color at index 0, secondary at index 1, so on and so forth.

```js
[
  { color: 'rgb(0,0,255)', count: 86  },
  { color: 'rgb(9,18,42)', count: 32  },
  { color: 'rgb(120,8,202)', count: 3  },
]
```

```javascript
import analyze from 'rgbaster'

const result = await analyze('/2px-blue-and-1px-red-image.png') // also supports base64 encoded image strings

console.log(`The dominant color is ${result[0].color} with ${result[0].count} occurrence(s)`)
// => The  dominant color is rgb(0,0,255) with 2 occurrence(s)

console.log(`The secondary color is ${result[1].color} with ${result[1].count} occurrence(s)`)
// => The  secondary color is rgb(255,0,0) with 1 occurrence(s)
```


## Configuration options

You may pass an optional second parameter, an object, with the following options:

#### `ignore`

An array of colors to ignore (in the form of `rgb`) when counting colors.

```js
const result = await analyze('/image.png', { ignore: [ 'rgb(255,255,255)', 'rgb(0,0,0)' ] })
```

#### `scale`

In order to achieve greater speed, you can have `rgbaster` scale down the image we use internally prior to analysis, thus decreasing accuracy.

```js
const result = await analyze('/image.png', { scale: 0.6 })
```

## Browser support

`rgbaster` depends on the following browser functionality:

* [Canvas](http://caniuse.com/#feat=canvas)
* [CORS](http://caniuse.com/#feat=cors)

## Maintainers

- [Alfred J. Kwack](https://github.com/AlfredJKwack)
- [Brian Gonzalez](https://github.com/briangonzalez)
- [Abdellah Hariti](https://github.com/a-hariti)

## About

`rgbaster` was created to modularize [adaptive backgrounds](http://briangonzalez.github.io/jquery.adaptive-backgrounds.js/). Check it out.

License
-------
MIT
npm package: @ramifyjs/core
Description: Reactive, in-memory database for JavaScript applications.
Author: Haroon
Latest version: 0.0.4

# @ramifyjs/core

Reactive, in-memory database for JavaScript applications.

Ramify JS is environment-agnostic—built for the browser, Node.js, and Edge runtimes. It provides a
lightweight, type-safe data store with live query observation for building reactive applications.

[Main Documentation →](https://ramifyjs.pages.dev)

[Benchmark](https://ramifyjs.pages.dev/docs/guides/performance#benchmark)

[React Hooks →](https://www.npmjs.com/package/@ramifyjs/react-hooks)

## Install

```bash
npm install @ramifyjs/core
# or
pnpm add @ramifyjs/core
# or
yarn add @ramifyjs/core
```

## Usage

```ts
import { Ramify, type Schema } from '@ramifyjs/core';

// 1. Define your schema
const schema = {
	users: {
		primaryKey: 'id',
		indexes: ['email'],
	},
};

// 2. Create the store
const db = new Ramify().createStore<{ users: Schema<User, 'id'> }>(schema);

// 3. Simple operations
db.users.put({ id: 1, name: 'John Doe', email: 'john@example.com' });

const user = db.users.where({ email: 'john@example.com' }).first();
console.log(user); // { id: 1, name: 'John Doe', email: 'john@example.com' }
```

## Features

- **Type-safe**: Full TypeScript support with schema-based type inference.
- **Reactive**: Observe changes with live queries.
- **Fast**: In-memory operations for high-performance data access.
- **Environment Agnostic**: Works in Browser, Node.js, and Edge.

## License

[LICENSE](/LICENSE)
npm package: @ramifyjs/react-hooks
Description: React hooks for Ramify JS - the reactive, in-memory database.
Author: Haroon
Latest version: 0.0.4

# @ramifyjs/react-hooks

React hooks for Ramify JS - the reactive, in-memory database.

Seamlessly integrate Ramify JS into your React applications with live query observers that
automatically re-render components when data changes.

[Main Documentation →](https://ramifyjs.pages.dev)

[Benchmark](https://ramifyjs.pages.dev/docs/guides/performance#benchmark)

[Core Package →](https://www.npmjs.com/package/@ramifyjs/core)

## Install

```bash
npm install @ramifyjs/react-hooks @ramifyjs/core
# or
pnpm add @ramifyjs/react-hooks @ramifyjs/core
# or
yarn add @ramifyjs/react-hooks @ramifyjs/core
```

## Usage

```tsx
import { useLiveQuery } from '@ramifyjs/react-hooks';
import { db } from './db'; // Your Ramify instance

function UserList() {
	const users = useLiveQuery(() => db.users.toArray(), { collections: [db.users], others: [] });

	return (
		<ul>
			{users.map((user) => (
				<li key={user.id}>{user.name}</li>
			))}
		</ul>
	);
}
```

## Features

- **Live Queries**: Automatically re-render components on data updates.
- **Type-safe**: Full TypeScript support.
- **Simple API**: Easy to use `useLiveQuery` hook.

## License

[LICENSE](/LICENSE)
npm package: @ramiidv/arca-sdk
Description: ⚠️ DEPRECATED - Use @ramiidv/arca-facturacion instead. This package is a compatibility wrapper.
Author: ramiidv
Latest version: 1.3.0
Deprecated: Este paquete fue renombrado a @ramiidv/arca-facturacion. Migrate: npm uninstall @ramiidv/arca-sdk && npm install @ramiidv/arca-facturacion

# @ramiidv/arca-sdk (DEPRECATED)

> **Este paquete fue renombrado a [`@ramiidv/arca-facturacion`](https://www.npmjs.com/package/@ramiidv/arca-facturacion).**

## Migración

```bash
npm uninstall @ramiidv/arca-sdk
npm install @ramiidv/arca-facturacion
```

Luego actualizá tus imports:

```diff
- import { Arca } from '@ramiidv/arca-sdk'
+ import { Arca } from '@ramiidv/arca-facturacion'
```

La API es 100% compatible. Este paquete es un wrapper de compatibilidad que re-exporta todo desde `@ramiidv/arca-facturacion` y será removido en una versión futura.
npm package: @raminjafary/nuxt-cache-module
Description: Cache components and pages on the server
Latest version: 0.1.7

# Nuxt Cache Module

<a href="https://www.npmjs.com/package/@raminjafary/nuxt-cache-module"><img src="https://badgen.net/npm/v/@raminjafary/nuxt-cache-module" alt="Version"></a>

> Cache components and pages on the server

## Installation

```bash
yarn add @raminjafary/nuxt-cache-module
# or
npm i @raminjafary/nuxt-cache-module
```


```js
module.exports = {
  buildModules: [
    '@raminjafary/nuxt-cache-module'
  ],
  // Module options
  cache: {
    // Set cache header on response when it hits cache.
    cacheHeader: 'x-cache',
    // Routes to be cached whether string or regexp.
    pages: [
      /^\/$/,
      /\/about/,
      '/todo'
    ],
    // Set time to live
    ttl: 60,
    // Configure Redis
    // All Redis options are supported
    redis: {
      port: 6379,
      host: 'localhost',
    }
  }
}
```

Component caching is also possible with the `cache` component. The default TTL is 60 seconds.
You can configure `ttl` in module option. A unique `id` and `timestamp` is used as cache key.

```vue
<cache :cache="{ id: 'title', lastUpdated: '1601923810954' }">
  <div>
    Hello World!
  <div>
</cache>
```

Note: you should **NOT** cache a component when:

- It has child components that may rely on global state.
- It has child components that produces side effects on the render context.
- You don't have user-specific content and you opt for page level caching.

For more information see [When to use component caching](https://ssr.vuejs.org/guide/caching.html#component-level-caching).

## Development
- Clone this repository.
- Install dependencies using `yarn install` or `npm install`.
- Start development server using `npm run dev` or `yarn dev`.
- Follow the [Conventional Commits Specification](https://conventionalcommits.org) for opening PRs.

## License

[MIT](./LICENSE)
npm package: @raminjafary/sura
Description: Generate PDF or screenshot with Node and Playwright
Latest version: 0.1.8

# Sura
[![npm (scoped with tag)](https://img.shields.io/npm/v/@raminjafary/sura/latest)](https://www.npmjs.com/package/@raminjafary/sura)

> Generate PDF or screenshot with Node and Playwright.

## Installation

```bash
npm i @raminjafary/sura
# or
yarn add @raminjafary/sura
```
## Features
* Generate PDF
* Take screenshot
* Support Sass/Scss
## Usage

### Generate PDF
It returns the `data` buffer and the `fsPath` of the generated file if `pdf.path` is specefied. 

```js
import { generateFile } from 'sura'

const { data, fsPath } = await generateFile({
      type: 'pdf',
      htmlPath: 'path/to/html/file',
      stylePath: path.join(
        __dirname,
        'public',
        'assets',
        'style.scss'
      ),
      pageLoad: {
        waitUntil: 'networkidle',
      },
      pdf: {
        path: 'path/to/save/file.pdf',
        format: 'A4',
        printBackground: false,
      },
    })

```
### Take screenshot
It returns the `data` in base64 and the `fsPath` of the generated file if `screenshot.path` is specefied. 

```js
import { generateFile } from 'sura'

const { data, fsPath } = await generateFile({
      type: 'screenshot',
      htmlPath: 'path/to/html/file',
      pageLoad: {
        waitUntil: 'networkidle',
      },
      screenshot: {
        path: 'path/to/save/image.png',
        fullPage: true,
      },
    })

```
## Options

| Option | Default | Description |
|--------|---------|-------------|
| type | `pdf` | File type to be generated |
| htmlPath | `undefined` | Directory or path of html file |
| stylePath | `undefined` | Directory or path of style file |
| pdf | see [Playwright `page.pdf`](https://playwright.dev/docs/api/class-page?_highlight=pdf#pagepdfoptions) | PDF options |
| screenshot | see [Playwright `page.screenshot`](https://playwright.dev/docs/api/class-page#pagescreenshotoptions) | Screenshot options |
| pageLoad | see [Playwright `page.goto`](https://playwright.dev/docs/api/class-page?_highlight=goto#pagegotourl-options) | Options for URL to navigate page to |

## Development
- Clone this repository.
- Install dependencies using `yarn install` or `npm install`.
- Start development server using `npm run dev` or `yarn dev`.

## License

[MIT](./LICENSE)
npm package: @raminjafary/vidar
Description: Generate high-performance heatmap
Latest version: 1.1.0

<h1 align="center">vidar</h1>
<div align="center">
<a href="https://www.npmjs.com/package/@raminjafary/vidar"><img src="https://badgen.net/npm/v/@raminjafary/vidar" alt="Version"></a>
</div>

<p align="center"><strong>Generate high-performance heatmap.</strong></p>

<p align="center">Fork of simpleheat.js with more focus on perfomance and maintainable code.</p>

[Demo](./playground/front)

## Usage

#### Rendering

```js
// create a heatmap object given an id or canvas reference
const heatmap = new Canvas2dRenderer(canvas);
// draw the heatmap
heatmap.draw();
```
#### Rate limit rendering 

You can throttle rendering per frames based on available resources. In the following example, the `draw` function will always be called with the latest data points with the frame rates browsers provide (e.g. 20 calls on 20fps).

```js
// throttle draw
const frame = ensureAvailableFrames(heatmap.draw)
// run on available frame, pass any args if you have
frame.request()
// cancel a frame
frame.cancel()
```

#### Data

```js
// set data of [[x, y, value], ...] format
heatmap.data = data

// add a data point
heatmap.addData(point);

// clear data
heatmap.clearData();
```

#### Appearance

```js
// set point radius and blur radius (25 and 15 by default)
heatmap.setRadius(radius, blur);

// set gradient colors as {<stop>: '<color>'}
// e.g. {0.4: 'blue', 0.65: 'lime', 1: 'red'}
heatmap.setGradient(gradient);

// call in case Canvas size changed
heatmap.resizeCanvas();
```

#### DOM Screenshot with [html2canvas](https://github.com/niklasvh/html2canvas)
```js
// you can take screenshot from DOM at a given time with data points baked in
const capture = document.querySelector('#capture')
html2canvas(capture)
  .then(canvas => {
    document.body.appendChild(canvas)
    canvas.style.display = 'none'
    return canvas
  })
  .then(canvas => {
    const image = canvas.toDataURL('image/png')
    // do whatever with data and then remove the canvas
    canvas.remove()
  })

```
## Development
- Clone this repository.
- Install dependencies using `yarn install` or `npm install`.
- Start development server using `yarn dev`.
- Follow the [Conventional Commits Specification](https://conventionalcommits.org) for opening PRs.

## License

[MIT](./LICENSE)
npm package: @raminjafary/workerman
Description: Run your JavaScript off the browser's main thread with inline workers
Author: raminjafary
Latest version: 0.1.2

# Workerman
> Run your JavaScript off the browser's main thread with inline workers



## Installation

```bash
npm i @raminjafary/workerman
# or
yarn add @raminjafary/workerman
```
## Usage

### Async/Await

```js
import Workerman from "@raminjafary/workerman";

const post = new Workerman(async function getUserPosts() {
  const res = await fetch('https://jsonplaceholder.typicode.com/posts?userId=1')
  return res.json()
})
;(async () => {
  const data = await post.proxy()
  // do sth with data
})()

```
### Promise

```js
import Workerman from "@raminjafary/workerman";

const post = new Workerman(id => {
  return fetch(`https://jsonplaceholder.typicode.com/posts/${id}`)
    .then(res => res.json())
    .then(json => json)
})
post.proxy(2).then((data) => {
  // do sth with data
}, console.error)

```

## License

[MIT](./LICENSE)