open-index/open-npm huggingface dataset:
npm package: @gapit/query-selector
Description: A component to query html elements.
Author: Gapit
Latest version: 0.1.0

# @gapit/query-selector

This component's function is to query for html elements.
It contains both certain and uncertain methods.

## querySelector

```ts
import { querySelector, querySelectorUnsafe } from "@gapit/query-selector";

const element = querySelector<SVGElement>(`#some-element`);
//  returns an element of given type, if element does not exist it throws an error.

const opt = querySelector<SVGElement>(`text`, element);
//  query existing element

const unsafeElement = querySelectorUnsafe<SVGElement>(`#some-element`);
//  returns a element of given type, if element does not exist return null.
```

## queryGroupPosition

```ts
import { querySelector, queryGroupPosition } from "@gapit/query-selector";

const element = queryGroupPosition<SVGElement>(
  querySelector(`#some-element`),
  0
);
//  returns child element of given element, if element does not exist it throws an error.

const unsafeElement = queryGroupPositionUnsafe<SVGElement>(
  querySelector(`#some-element`),
  0
);
//  returns child element of given element, if element does not exist return null.
```

## queryGroupPositionBySelector

```ts
import { queryGroupPositionBySelector } from "@gapit/query-selector";

const element = queryGroupPositionBySelector<SVGElement>(`#some-element`, 0);
//  returns child element of given query at given position, if element does not exist it throws an error.
```

## querySelectorAll

```ts
import {
  querySelector,
  querySelectorAll,
  querySelectorAllUnsafe,
} from "@gapit/query-selector";

const element = querySelectorAll<SVGElement>(`text`);
//  returns all text elements as a node list.

const opt = querySelector<SVGGElement>(`#some-element`);
const queryExisting = querySelectorAll<SVGRectElement>(`[rect]`, opt);
//  returns all rect elements within given element.

const unsafeElement = querySelectorAllUnsafe<SVGElement>(`path`);
//  returns all elements of given selector, if no element fits the selector return null.
```
npm package: @gappl/ngx-sign-pad
Description: An Angular wrapper for [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).
Latest version: 1.0.2

# ngx-sign-pad
ngx-sign-pad is an Angular wrapper for [szimek/signature_pad](https://www.npmjs.com/package/signature_pad).

## NOTICE
This is a fork of https://github.com/HeicoJoswig/ngx-sign-pad to make it ng 9 compatible.

## Usage

### 1. Install
`npm install ngx-sign-pad --save`

### 2. Import SignaturePadModule
```typescript

import { SignPadModule } from 'ngx-sign-pad';

...

@NgModule({
  declarations: [ ],
  imports: [ SignPadModule ],
  providers: [ ],
  bootstrap: [ AppComponent ]
})
```

### 3. Use ngx-sign-pad

```typescript
import { Component, ViewChild } from '@angular/core';
import { EImageType, SignPadComponent } from 'ngx-sign-pad';

@Component({
  template: '<ngx-sign-pad [(signature)]="signature" [type]="imageTypes.SVG"></ngx-sign-pad>'
})

export class AppComponent{

  imageTypes = EImageType;
  signature = null;
  @ViewChild(SignPadComponent) signaturePad: SignPadComponent;
  
  constructor() {
  }

  clear() {
    this.signaturePad.clear();
  }
}
```
npm package: @gaql/cli
Description: CLI tool for Google Ads Query Language (GAQL) validation and type generation
Author: kage1020
Latest version: 0.1.3

# @gaql/cli

Command-line interface for Google Ads Query Language (GAQL) validation.

## Installation

```bash
# Install globally
npm install -g @gaql/cli

# Or use with npx
npx @gaql/cli validate query.ts
```

## Usage

### Basic Validation

```bash
# Validate GAQL queries in a file
gaql validate query.ts

# Validate from stdin
echo "SELECT campaign.id FROM campaign" | gaql validate

# Validate with pipe
cat query.ts | gaql validate
```

### Options

```bash
# Specify API version (19, 20, or 21)
gaql validate query.ts --api-version 21

# Output in JSON format
gaql validate query.ts --format json

# Disable colored output
gaql validate query.ts --no-color

# Show help
gaql validate --help
```

## Examples

### Example 1: Validate a TypeScript file

```typescript
// query.ts
const query = `
  SELECT
    campaign.id,
    campaign.name,
    metrics.clicks
  FROM campaign
  WHERE campaign.status = 'ENABLED'
`;
```

```bash
gaql validate query.ts
```

Output:

```
✔ Read file: query.ts

=== GAQL Validation Results ===

Total queries: 1
✓ Valid: 1

✓ Query at line 2: Valid
```

### Example 2: Invalid query with suggestions

```typescript
// invalid.ts
const query = `
  SELECT
    campaign.invalid_field,
    metrics.clicks
  FROM campaign
`;
```

```bash
gaql validate invalid.ts
```

Output:

```
✔ Read file: invalid.ts

=== GAQL Validation Results ===

Total queries: 1
✗ Invalid: 1

✗ Query at line 2: Invalid
  Query:
    SELECT
        campaign.invalid_field,
        metrics.clicks
      FROM campaign

  Errors:
    • Invalid field: campaign.invalid_field for resource campaign
      Suggestion: campaign.id
```

### Example 3: JSON output for CI/CD

```bash
gaql validate query.ts --format json
```

Output:

```json
{
  "totalQueries": 1,
  "validQueries": 1,
  "invalidQueries": 0,
  "results": [
    {
      "query": "SELECT campaign.id FROM campaign",
      "line": 2,
      "valid": true,
      "errors": []
    }
  ]
}
```

## Exit Codes

- `0`: All queries are valid
- `1`: At least one query is invalid or an error occurred

## Integration

### Git Hooks

Add to `.git/hooks/pre-commit`:

```bash
#!/bin/sh
gaql validate src/**/*.ts --no-color
```

### CI/CD

```yaml
# .github/workflows/validate.yml
name: Validate GAQL Queries

on: [push, pull_request]

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
      - run: npm install -g @gaql/cli
      - run: gaql validate src/**/*.ts --format json
```

## License

MIT
npm package: @gar/hapi-json-api
Description: Hapi plugin for enabling/enforcing JSONAPI specification
Author: Kjell-Morten Bratsberg Thorsen
Latest version: 4.0.0

# hapi-json-api

*Note:* This package has been archived, as the maintainer moved away from Hapi
when the project was first discontinued. Hapi seems to be alive again, but this
package will not be updated anymore. It is updated to Hapi 21, but this is done
naivly without much testing. Use it if it works. :)

Hapi plugin for enabling/enforcing [JSON-API specification](http://jsonapi.org).

Original project transferred from [@wraithgar](https://github.com/wraithgar).

[![Current Version](https://img.shields.io/npm/v/@gar/hapi-json-api.svg)](https://www.npmjs.org/package/@gar/hapi-json-api)
[![Greenkeeper badge](https://badges.greenkeeper.io/kjellmorten/hapi-json-api.svg)](https://greenkeeper.io/)

### Support

We support Hapi 21 from version 4.x, and require Node >= 14.15.

## Getting started

### Installing

```shell
npm install @gar/hapi-json-api
```

## Example of use

```javascript
const jsonApi = require('@gar/hapi-json-api');

// where server is a hapi server, for hapi 21:
await server.register({
    plugin: jsonApi,
    options: {}
});
```

### Configuration

Pass an optional `meta` parameter to options to have that included in
the `meta` response namespace for all replies from your server

## Features

- Enforces Accept/Content-type rules defined in spec

- Rewrites Boom errors to be spec compliant

**Note:** Objects coming back from your handlers is not validated as of now.
It is assumed to be in proper json-api format and simply passed on.

## Contributing

Please read [CONTRIBUTING](https://github.com/kjellmorten/hapi-json-api/blob/master/CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/kjellmorten/hapi-json-api/blob/master/LICENSE.md) file for details.
npm package: @gar/promise-retry
Description: Retries a function that returns a promise, leveraging the power of the retry module.
Latest version: 1.0.3

# @gar/promise-retry

This is a fork of [promise-retry](https://npm.im/promise-retry). See the [CHANGELOG.md](./CHANGELOG.md) for more info.
It also inlines and updates the original [retry](https://github.com/tim-kos/node-retry) package that was being promisified.

Retries a function that returns a promise, leveraging the power of the [retry](https://github.com/tim-kos/node-retry) module to the promises world.

There's already some modules that are able to retry functions that return promises but they were rather difficult to use or do not offer an easy way to do conditional retries.


## Installation

`$ npm install promise-retry`


## Usage

### retry(fn(retry, number, operation), [options])

Calls `fn` until the returned promise ends up fulfilled or rejected with an error different than a `retry` error.
The `options` argument is an object which maps to the original [retry](https://github.com/tim-kos/node-retry) module options:

- `retries`: The maximum amount of times to retry the operation. Default is `10`.
- `factor`: The exponential factor to use. Default is `2`.
- `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`.
- `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`.
- `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
- `forever`: Whether to retry forver, default is false.
- `unref`: Whether to [unref](https://nodejs.org/api/timers.html#timers_unref) the underlying `setTimeout`s.
- `maxRetryTime`: Maximum number of milliseconds that the retried operation is allowed to run.

`options` can also be a Number, which is effectively the same as pasing `{ retries: Number }`


The `fn` function will be called with the following parameters:
 - A `retry` function as its first argument that should be called with an error whenever you want to retry `fn`. The `retry` function will always throw an error.
 - The current retry number being attempted
 - The retry operation object itself from which will allow you to call things like `operation.reset()`

If there are retries left, it will throw a special `retry` error that will be handled internally to call `fn` again.
If there are no retries left, it will throw the actual error passed to it.

## Example
```js
const { retry } = require('@gar/promise-retry');

// Simple example
retry(function (retry, number) {
    console.log('attempt number', number);

    return doSomething()
    .catch(retry);
})
.then(function (value) {
    // ..
}, function (err) {
    // ..
});

// Conditional example
retry(function (retry, number) {
    console.log('attempt number', number);

    return doSomething()
    .catch(function (err) {
        if (err.code === 'ETIMEDOUT') {
            retry(err);
        }

        throw err;
    });
})
.then(function (value) {
    // ..
}, function (err) {
    // ..
});
```

## Tests

`$ npm test`

## License

Released under the [MIT License](http://www.opensource.org/licenses/mit-license.php).
npm package: @gar/promisify
Description: Promisify an entire class or object
Author: Gar
Latest version: 1.1.3

# @gar/promisify

### Promisify an entire object or class instance

This module leverages es6 Proxy and Reflect to promisify every function in an
object or class instance.

It assumes the callback that the function is expecting is the last
parameter, and that it is an error-first callback with only one value,
i.e. `(err, value) => ...`. This mirrors node's `util.promisify` method.

In order that you can use it as a one-stop-shop for all your promisify
needs, you can also pass it a function.  That function will be
promisified as normal using node's built-in `util.promisify` method.

[node's custom promisified
functions](https://nodejs.org/api/util.html#util_custom_promisified_functions)
will also be mirrored, further allowing this to be a drop-in replacement
for the built-in `util.promisify`.

### Examples

Promisify an entire object

```javascript

const promisify = require('@gar/promisify')

class Foo {
  constructor (attr) {
    this.attr = attr
  }

  double (input, cb) {
    cb(null, input * 2)
  }

const foo = new Foo('baz')
const promisified = promisify(foo)

console.log(promisified.attr)
console.log(await promisified.double(1024))
```

Promisify a function

```javascript

const promisify = require('@gar/promisify')

function foo (a, cb) {
  if (a !== 'bad') {
    return cb(null, 'ok')
  }
  return cb('not ok')
}

const promisified = promisify(foo)

// This will resolve to 'ok'
promisified('good')

// this will reject
promisified('bad')
```
npm package: @garafu/mysql-fileloader
Description: Importing SQL string used in MySQL from external SQL files.
Author: Akinari Tsugo
Latest version: 0.0.3

mysql-fileloader
====

This module load MySQL SQL string from sql files.
Recursively reads SQL files that exist under the specified folder.

## Install

```
npm install @garafu/mysql-fileloader
```

or

```
yarn add @garafu/mysql-fileloader
```

## Usage

When read the required SQL string from specified file each time.

```
const path = require("path");
const root = path.join(__dirname, "./sql");
const { sql } = require("@garafu/mysql-fileloader")({ root });

(async () => {
  console.log(await sql("SELECT_USER_BY_ID")); // <-- "SELECT * FROM user WHERE id=?"
})();
```

When reading synchronously all SQL files from under specified folder.

```
const path = require("path");
const SQL = require("mysql-file").loadSync(path.join(__dirname, "./sql"));

console.log(SQL["SELECT_USER_BY_ID"]); // <-- "SELECT * FROM user WHERE id=?"
```

## Documents

* function
  * `function init([options]): void`
  * `function sql(name): Promise<string>`
  * `function loadSync(root [, options]): SQL`
  * `function loadAsync(root [, options]): SQL`

### function

_`function init([options]): void`_

Initialize SqlFileLoader.

**arguments**
* options
    * root  {string}  Root directory path of loading SQL files.

**returns**

This module object.

_`function sql(name): Promise<string>`_

Load SQL string from specified file asyncnously.

**arguments**
* name  {string}  SQL file name.

**returns**
`Promise<string>` SQL string

_`function loadSync(root, options): SQL`_

Load sql string syncronously from sql files under the specified folder.

**arguments**
* root {string} Start directory for searching sql files.
* options {object} See options section.

**returns**

_`function loadAsync(root, options): SQL`_

Load sql string *asyncronously* from sql files under the specified folder.

**arguments**
* root {string} Start directory for searching sql files.
* options {object} See options section.

**returns**


### options

* _`recursive` {boolean}_ : Whether you want to recoursive search or not.

### returns
_`SQL`_

Return value is object that includes key which is file name and value which is sql string.


## Licence

[MIT](https://raw.githubusercontent.com/garafu/mysql-file/master/LICENSE)

## Author

[Akinari Tsugo](https://github.com/garafu)
npm package: @garage-panda/use-before-unload
Description: [![npm version](https://badge.fury.io/js/%40garage-panda%2Fuse-before-unload.svg)](https://badge.fury.io/js/%40garage-panda%2Fuse-before-unload)
Author: Garage Panda
Latest version: 0.1.0

[![npm version](https://badge.fury.io/js/%40garage-panda%2Fuse-before-unload.svg)](https://badge.fury.io/js/%40garage-panda%2Fuse-before-unload)

# use-before-unload

## About

A React hook that uses the onbeforeunload (beforeunload) event and tracks when the user has been Refreshed or Canceled the default browser message.
It is impossible to track if the user has left the page and is not a good idea to execute code after that.

## Install

```
npm i @garage-panda/use-before-unload
```

## Usage

```typescript
import React from "react";
import { useBeforeUnload } from "@garage-panda/use-before-unload";

function App() {
  const setEnabledBeforeUnload = useBeforeUnload({
    initEnable: false, // do you need to be enabled by default
    onRefresh: () => {
      // the page has been refreshed (the user has clicked Reload)
    },
    onCancel: () => {
      // the user has clicked Cancel
    }
  });

  React.useEffect(() => {
    setEnabledBeforeUnload(true); // you can dynamically enable or disable the beforeunload event

    if (!sessionStorage.length) {
      // the only way to know that the user has land on your site (and has not refreshed the page)
    }
  }, []);
}
```
## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## Support

If you like what you see, feel free to support us!

<a href="https://www.buymeacoffee.com/garage.panda">
<img src="https://img.buymeacoffee.com/button-api/?text=Buy us a beer&emoji=:beer:&slug=garage.panda&button_colour=FFDD00&font_colour=000000&font_family=Poppins&outline_colour=000000&coffee_colour=ffffff"></a>

## License

[MIT](https://choosealicense.com/licenses/mit/)
npm package: @garage11/commitlint-circle
Description: Lint all relevant commits for a change or PR on Circle CI
Author: Garage11
Latest version: 1.0.2

> Lint all relevant commits for a change or PR on Circle CI

# commitlint-circle

This package is a convenience wrapper around `commitlint`, 
providing zero-configuration linting of all relevant commits
for a given change/build combination.

## Getting started

```
yarn add commitlint-circle --dev
```

```yml
# .circleci/config.yml
- run: yarn commitlint-circle
```

## Screenshots

##### When building a PR

![PR Lookup](./.github/pr-lookup.png)

##### When building a change

![SHA Lookup](./.github/sha-lookup.png)
npm package: @garage11/vue-compiler
Description: Simple and fast alternative to Vue SFC
Latest version: 1.1.0

# vue-compiler
Simple and fast Vue 2 template compiler; mainly a thin wrapper around the
reference Vue template compiler.

# Usage
    npm i -g @garage11/vue-compiler
    # produces a commonjs module like `module.exports.tabs_TabList`
    vc -i '../tabs/src/*.vue' -s src -c

# Options
    --namespace, -n  changes the default namespace.                         [text]
    -c, --commonjs   use commonjs format                [boolean] [default: false]
    -i, --input      glob pattern to vue templates.              [text] [required]
    -o, --output     output file to use.                                    [text]
    -s, --skip       skip parts of the template path to name.              [lijst]
    -h               Show help                                           [boolean]
npm package: @garage11/vue-compiler-gulp
Description: Gulp wrapper around @garage11/vue-compiler
Author: Jeroen van Veen
Latest version: 1.1.0

# vue-compiler-gulp
Thin wrapper around [@garage11/vue-compiler](https://github.com/garage11/vue-compiler),
which is a simple and fast .vue template compiler for Gulp. It compiles all templates in
a project to a javascript object. Each template in the object has an r and s property.
Vue components are able to use them like this:

    Vue.component('MyComponent', {
        render: template.r,
        staticRenderFns: template.s,
        ...
    })


The template namespace is configurable. Template names are generated according
to their relative path. You can also use the `commonjs` option to generate a
commonjs template module. This can be used to require the templates in your code,
in case you want to keep the templates within a closure and part of an existing
browserify entry. Inline stylesheets and javascript support is left
out intentionally, due to separation of concerns.

# Install and usage
Installation is simple. Just include it with npm:

    npm install @garage11/vue-compiler-gulp --save-dev

Make a templates directory and optionally subdirectories to use template
prefixes, e.g. `templates/mymodule`:
Then use it in your gulp file like:

    const vueCompiler = require('vue-compiler-gulp')

    ...

    gulp.task('templates', 'Build Vue templates', () => {
        gulp.src('./src/templates/**/*.vue')
        .pipe(vueCompiler({
            pathfilter: ['src', 'templates'],
        }))
        .on('error', notify.onError('Error: <%= error.message %>'))
        .pipe(ifElse(PRODUCTION, () => uglify()))
        .on('end', () => {
            if (!PRODUCTION) del(path.join(BUILD_DIR, 'templates.js.gz'), {force: true})
        })
        .pipe(concat('templates.js'))
        .pipe(insert.prepend('window.templates={};'))
        .pipe(gulp.dest(BUILD_DIR))
        .pipe(size(extend({title: 'templates'}, sizeConfig)))
        .pipe(ifElse(PRODUCTION, () => gzip(gzipConfig)))
        .pipe(ifElse(PRODUCTION, () => gulp.dest(BUILD_DIR)))
        .pipe(ifElse(PRODUCTION, () => size(extend({title: 'templates[gzip]'}, sizeConfig))))
        .pipe(ifElse(isWatching, livereload))
    })