open-index/open-npm huggingface dataset:
npm package: @gasrunners/common-abi
Description: Common Ethereum contract ABIs
Latest version: 1.0.2

# Common ABI

[![npm
(tag)](https://img.shields.io/npm/v/@gasrunners/common-abi)](https://www.npmjs.com/package/@gasrunners/common-abi)

The Common ABI package exposes json ABIs for common Ethereum smart contracts.

## Usage

Install:

```bash
npm install @gasrunners/common-abi
```

Import the ABIs that you need:

```ts
import { ERC20_ABI, ERC721_ABI } from '@gasrunners/common-abi'
```

## ABIs

The importable ABIs included are listed below:

- BalancerVault_ABI
- EnsPublicResolver_ABI
- EnsRegistrar_ABI
- ERC20_ABI
- ERC721_ABI
- ERC1155_ABI
- Multicall2_ABI
- UniswapV2Factory_ABI
- UniswapV2Pair_ABI
- Weth_ABI
npm package: @gasrunners/evm-fetch
Description: Fetch onchain data from the EVM chain contracts using multicaller contract
Latest version: 1.0.0

# EVMFetch

[![npm
(tag)](https://img.shields.io/npm/v/@gasrunners/evm-fetch)](https://www.npmjs.com/package/@gasrunners/evm-fetch)

EVMFetch is a simple wrapper around multicaller contracts that makes fetching
onchain data simple and intuitive.

## Usage

Install:

```bash
npm install @gasrunners/evm-fetch
```

Instantiate an EVMFetch instance:

```ts
import { EVMFetch, Network } from '@gasrunners/evm-fetch'
import { ERC20_ABI } from '@gasrunners/common-abi'

evmFetch = new EVMFetch({
  network: Network.MAINNET,
  provider: <YOUR_RPC_URL> // e.g. `https://mainnet.infura.io/v3/${YOUR_INFURA_KEY}`,
})
```

Add multical onchain calls from different contracts:

```ts
evmFetch
  .addCall({
    key: 'dai.name',
    address: '0x6B175474E89094C44Da98b954EedeAC495271d0F', // Dai ERC20
    function: 'name',
    abi: ERC20_ABI,
  })
  .addCall({
    key: 'uni.name',
    address: '0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984', // Uniswap ERC20
    function: 'name',
    abi: ERC20_ABI,
  })
```

Then fetch the results:

```ts
const data = await evmFetch.fetch()

console.log(data) // { dai: 'Dai Stablecoin', uni: 'Uniswap' }
```
npm package: @gassepouille/image-colors
Description: Get main colors values from an image
Latest version: 1.0.0

#Image colors

Javascript module to get a list of the most used colors in an image

usage : 

```javascript
let imageColors = new ImageColors({
        removeMainBlack:false,
        removeMainWhite:false,
        maxColors : 5,
        trimSimilarColors: true,
        thresholdSimilarColors : 35,
});
let url = "./sample.jpg";
let colors = await imageColors.getColors(url);
```

npm install @gassepouille/image-colors
npm package: @gasstack/db
Description: Google Apps Script Database microframework
Author: Gianmaria Canossa
Latest version: 0.3.3

# @gasstack/db

The package is meant to enable the useage of a Google Sheet as a database-like store.

## Description

The package allows to define schemas in a way similar to [Drizzle](https://orm.drizzle.team/) and use them to create typed *ContextRef*s. The *ContextRef*s can be used with a typed basic CRUD API and as enablers of a more advanced ORM-like API.
Through the basic *ContextRef*s is possible to read, insert, delete and update entities of a given sheet range, both singularly and by group of contiguous rows.

Using a _ManagedContexRef_ is possible to opearate in memory, adding, removing or updating directly in place entity objects both with the possibility to _rollback_ the operations or _commit_ them.

## Usage

The schema definition allows you to create a map-like object, specifing for each key both the data type and the position
of the corresponding column in the sheet range.
It is also possibile to _decorate_ a field with modifiers hinting _autogeration_ or _readonlyness_.

```ts
const mapping = {
  id: numeric("Num"),
  name: text(1),
  seq: serial(numeric(2)),
  fseq: formula(numeric(3)),
  score: boolean("Rank"),
  link: hyperLink("Link"),
};
```

The schema defined is than used to obtain *ContextRef*s:

```ts
const ctx = createContext<typeof mapping>(
  ss,
  { a1NotationRange: "ranges!O5:T5" },
  mapping
);
```

And use them with the CRUD or the ORM API:

```ts
let item = insertAt(
  ctx,
  {
    id: 5,
    name: "five",
    score: true,
    link: { url: "https://www.google.com", label: "Page 5" },
  },
  1
);

console.log(read(ctx));

const orm = createManagedContext(ctx);

item = orm.list()[0];

item.name = "test";

commit(orm);
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gasstack/fs
Description: Google Apps Script drive fs utilities
Author: Gianmaria Canossa
Latest version: 0.4.0

# @gasstack/fs

The package is meant to ease the useage of the Google App Script _DriveApp_ functionalities.

## Description

The package allows to explore folders and files using arrays and operators instead of iterators and verbose callback-based method calls.

## Usage

It is possible to implement filtering with array functions

```ts
const recentFilesSize = getFiles("<folder id>")
  .filter((p) => p.getLastUpdated() < 7 * 24 * 60 * 60 * 1000)
  .reduce((acc, p) => acc + p.getSize());
```

It is also possible to use an base iterator to implement cursor based pagination:

```ts
const filesIterator = DriveApp.getFolderById("<folder id>").getFiles();

let page = fromDriveIterator(filesIterator, 10);

page = continueFiles(filesIterator.getContinuationToken(), 10);
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gasstack/http
Description: Google Apps Script http api microframework
Author: Gianmaria Canossa
Latest version: 0.2.1

# @gasstack/http

The package is http api microframework, inspired by [Express.js](https://expressjs.com/), meant to allow the implementation of REST APIs with Google Apps Script.

## Description

The package allows create an http API.

## Usage

The library expose an **appBuilder** function which allows you to create and configure an http response handler for the special function events **doGet** and **doPost** of the Google Apps Script environment.

You can create and configure an **app function** and use it to handle both special events.

```ts
const app = appBuilder((builder) => {
  builder
    .use((req, res) => {
      console.log(req.contextPath);
    })
    .get("/api/:name", (req, res) => {
      respond(res).text(`Hello ${req.pathParams!.name}`);
    })
    .all("/view/:name", (req, res) => {
      respond(res).view("index.e2e", { name: req.pathParams!.name });
    });
});

function doGet(e: GoogleAppsScript.Events.DoGet) {
  return app(e);
}

function doPost(e: GoogleAppsScript.Events.DoPost) {
  return app(e);
}

// Or you can install it directly
installHttpApp(app);
```

It is possible to insert special segments in the mapping url pattern in the form of **:_name_** which will be matched against the real request setting the keys of the _params_ member of the request object.

To build the response an helper is available wich allows and simplifies the production of text, downloadable content, json and templated html views.

```ts
type HttpResponseHelper = {
  ok(): void;
  view(path: string, params: ViewParams): void;
  json(content: any): void;
  text(content: string): void;
  download(content: string, filename: string): void;
  error(error: string): void;
};
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gasstack/kv
Description: Google Apps Script key-value store microframework
Author: Gianmaria Canossa
Latest version: 0.3.1

# @gasstack/kv

The package is meant to allow the creation and usage of key-value store in Google App Script applications.

## Description

The package allows create basic managed (handling serialization and deserialization) KV store using _Properties_, _Spreadsheets_, _Documents_, etc.

## Usage

It is possible to create a KV store from a property store:

```ts
const kv = createPropertiesStore(PropertiesService.getDocumentProperties());

kv.set("obj", { name: "test", value: 10 });

console.log(kv.get("obj").value);
```

It is possible to create a KV store from a cache:

```ts
const kv = createCacheStore(CacheService.getDocumentCache());

kv.set("obj", { name: "test", value: 10 });

console.log(kv.get("obj").value);
```

It is possible to create a KV store from a Spreadsheet range:

```ts
const kv = createSpreadsheetStore(
  SpreadsheetApp.getActive()
    .getRange("B1:C1")
    .getDataRegion(SpreadsheetApp.Dimension.ROWS)
);

kv.set("obj", { name: "test", value: 10 });

console.log(kv.get("obj").value);
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gasstack/manifest
Description: Google Apps Script manifest building and configuration utilities.
Author: Gianmaria Canossa
Latest version: 0.3.1

# @gasstack/manifest

The package is meant to ease and automate the process of creating a Google App Script manifest file, expecially the options regarding addons.

## Description

The package provide a fluent based api to configure a manifest file, managing entangled options such as function names, necessary oauth scopes and url whitelisting both for UrlFetch and OpenLink scenarios.

The package contains also a [Rollup](https://rollupjs.org/) / [Vite](https://vitejs.dev/) compatible plugin, which serach for the **.clasp.json** configuration file and rewrites the **appsscript.json** manifest file according to the fluent configuration.

## Usage

Export a constant created with the fluent manifest configuration:

```ts
export const CONFIG = defineManifest((builder) =>
  builder
    .withScopes((p) => p.withTriggerManagement())
    .withAddOn("Test", "https://logo.org", test_home, (b) =>
      b.forCalendar((t) => t.withCurrentEventAccess("READ_WRITE")).forDrive()
    )
);
```

Configure Vite or Rollup withthe given plugin:

```ts
import { defineConfig } from "vite";
import { manifestPligin } from "@gasstack/manifest";
import { CONFIG } from "./index";

export default defineConfig({
  root: "./src",
  plugins: [manifestPligin({ manifest: manifest })],
});
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gasstack/rpc
Description: Google Apps Script rpc client/server interaction support
Author: Gianmaria Canossa
Latest version: 0.1.3

# @gasstack/rpc

The package is meant to simplify the interaction between a contained webpage and the server side of a Google Apps Script application, beeing it a webapp or an addon.

## Description

The package is inspierd by [tRPC]("https://trpc.io/") and provides a way to describe **scoped endpoint**s as functions map on the server side, that can be invoked by a **typed client proxy** on the client side. Moreover, a mocking facility is provided in order to allow local testing of the clien application before the actual deploy to Google Apps Script.

## Usage

On the server side create a scoped endpoint:

```ts
const serverApi = {
  sum(a: number, b: number): number {
    return a + b;
  },
  print(s: string): void {},
  wait(range: [number, number]): void {},
} satisfies ServerRunMethods;

const endpoint = createEndpoint(serverApi);

export serverApiType = typeof serverApi;
```

Then create a function in the global scope to work as a scoping functio. A scoping function is a function whose first parameter is the name of another function which it scopes. Inside it just call the **.invoke** method of the created endpoint:

```ts
function testMyApi(fnName: string, ...params: any[]): any {
  return endpoint.invoke(fnName, ...params);
}
```

On the client side, import the exported _server api type_ and create a typed **client proxy**:

```ts
const client = createScopedClient<serverApiType>("testMyApi");
```

It is even possible to create a global scoped client proxy, if the type given describes a set of global functions:

```ts
const globalClient = createClient<serverApiType>();
```

It is then possible to jsut use the proxies with async/await typed interfaces:

```ts
await client.sum(1, 2);
```

In order to test your client app locally it is possible to setup a mock of your RPC interface:

```ts
setupMocks(
  {
    async sum(a: number, b: number): Promise<number> {
      return a + b;
    },
    async print(s: string): Promise<void> {},
    async wait(range: [number, number]): Promise<void> {},
  },
  {
    testMyApi: {
      async sum(a: number, b: number): Promise<number> {
        return a + b;
      },
      async print(s: string): Promise<void> {},
      async wait(range: [number, number]): Promise<void> {},
    },
  }
);
```

After that you can even use the native Google Apps Script proxy:

```js
window.google.script.run
  .withSuccessHandler((value) => console.log(value))
  .sum(1, 2);
```

## Example

Have a look to the [e2e test](main.e2e.ts).

## API

[API Reference](docs/modules.md)
npm package: @gastiennelea/quasar-app-extension-simple-auth
Description: A Quasar App Extension
Author: Gastienne
Latest version: 0.0.2

Quasar App Extension simple-auth
===

simple-auth is a quasar app extension providing a simple example of login with app extension.

# Install
```bash
quasar ext add @gastiennelea/simple-auth
```
Quasar CLI will retrieve it from the NPM registry and install the extension to your project.

## Prompts

You will be prompt to provide the base api url and the login url. By default, the api url is https://reqres.in for placeholder login api

# Uninstall
```bash
quasar ext remove @gastiennelea/simple-auth
```

# Info
> once the plugin installs, you can access the login page in `/login`
npm package: @gastier/customelement-passwordtoggle
Description: Toggle password element
Author: Guillaume Astier
Latest version: 0.0.4

# Customized built-in elements `<password-toggle>`

[![npm](https://img.shields.io/npm/v/@gastier/customelement-passwordtoggle.svg)](http://npm.im/@gastier/customelement-passwordtoggle)

The goal of this module is to have a reusable component to toggle password from password type to text type.

* [Demo](https://spooky063.github.io/CustomElement-PasswordToggle/)

## Install
```bash
npm i @gastier/customelement-passwordtoggle
```

## Usage
To attach toggle button to input, use `input` attribute to list `name` password attribute.

```html
<-- Create a simple toggle button  -->
<input type="password" name="password"/>
<password-toggle input="password"></password-toggle>
```

```html
<-- Create a toggle button link to multiple input -->
<input type="password" name="password"/>
<input type="password" name="confirm"/>
<password-toggle input="password,confirm"></password-toggle>
```

```html
<-- Restricted button for device screen > 800px -->
<input type="password" name="password"/>
<password-toggle input="password" resolution-min="800"></password-toggle>
```

## Attributes

| Attribute        | Type     | Description                                                  |
|------------------|----------|--------------------------------------------------------------|
| `input`          | `string` | Name of input name attribute (separate by comma if multiple) |
| `resolution-min` | `int`    | Number of pixels minimal to render custom element            |
npm package: @gastier/customelement-textclipboard
Description: Copy text to clipboard
Author: Guillaume Astier
Latest version: 0.0.1

# Customized built-in elements `<text-clipboard>`

[![npm](https://img.shields.io/npm/v/@gastier/customelement-textclipboard.svg)](http://npm.im/@gastier/customelement-textclipboard)

The goal of this module is to have a reusable component to copied text to clipboard.

* [Demo](https://spooky063.github.io/CustomElement-TextClipboard/)

## Install
```bash
npm i @gastier/customelement-textclipboard
```

## Usage
To attach clipboard button to element, use `target` attribute with existing unique selector.

```html
<-- Create a clipboard button -->
<span id="id">Text to copy</span>
<text-clipboard target="#id"></text-clipboard>
```

```html
<-- Create a clipboard button without attribute select the previous element -->
<code>jdikappelndnso5dfsa</code>
<text-clipboard></text-clipboard>
```

## Attributes

| Attribute | Type     | Description                                     |
|-----------|----------|-------------------------------------------------|
| `target`  | `string` | Selector corresponding to a valid HTML element  |

## Custom event
I create a custom event `afterselect` to add an message flash for example.  
This event is dispatch after the clipboard action is launch.

```javascript
document.addEventListener('afterselect', e => { 
    console.log(`Text copied is ${e.detail.text}`); 
});
```
npm package: @gastonalonso/ffprobe-static
Description: Static binaries for ffprobe.
Author: joshwnj
Latest version: 1.1.0

ffprobe-static
====

Static binaries for `ffprobe`.

Based on <https://github.com/eugeneware/ffmpeg-static>.

Binaries are from <http://ffmpeg.zeranoe.com/builds/>

Usage
----

```js
var ffprobe = require('ffprobe-static');
console.log(ffprobe.path);
```

Binaries
----

* [ARM (Apple Silicon) Mac OSX](https://osxexperts.net/)
* [64 bit Mac OSX](https://evermeet.cx/ffmpeg/)
* [64 bit Linux](http://johnvansickle.com/ffmpeg/)
* [32 bit Linux](http://johnvansickle.com/ffmpeg/)
* [64 bit Windows](http://ffmpeg.zeranoe.com/builds/win64/static/)
* [32 bit Windows](http://ffmpeg.zeranoe.com/builds/win32/static/)

Acknowledgements
----

Special thanks to [joshwnj](https://github.com/joshwnj) for <https://github.com/joshwnj/ffprobe-static>, which this is based upon.