# greasetools

> Functions and other tools for GreaseMonkey UserScript development.

Latest version **0.5.0** (published 2022-02-22) · MIT OR Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install greasetools
pnpm add greasetools
yarn add greasetools
bun add greasetools
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2022-02-22 |
| First published | 2021-10-30 |
| Weekly downloads | 0 |
| License | MIT OR Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 40.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Adam Thompson-Sharpe |
| Maintainers | mysteryblokhed |

## Links

- npm: https://www.npmjs.com/package/greasetools
- Repository: https://gitlab.com/MysteryBlokHed/greasetools
- Homepage: https://gitlab.com/MysteryBlokHed/greasetools#greasetools
- Issues: https://gitlab.com/MysteryBlokHed/greasetools/issues
- npm.io page: https://npm.io/package/greasetools

## Dependencies (1)

- [@types/greasemonkey](https://npm.io/package/@types/greasemonkey.md) ^4.0.2

## Recent versions

- 0.5.0 (latest) — 2022-02-22
- 0.4.0 — 2022-01-19
- 0.3.0 — 2021-12-18
- 0.2.0 — 2021-11-05
- 0.1.0 — 2021-10-30

## README

# GreaseTools [![Build Badge]](https://gitlab.com/MysteryBlokHed/greasetools/-/pipelines) [![NPM Badge]](https://www.npmjs.com/package/greasetools) [![License Badge]](#license)

Functions and other tools for GreaseMonkey UserScript development.

## Documentation

Documentation for the main branch is hosted at <https://greasetools.adamts.me>.
Documentation can be built from a cloned repository by running `yarn doc`.

## Use

Most functions will require some `@grant`'s to work properly,
but can fall back to other things like the browser's localStorage if grants aren't found.
Information for each function can be found in its docs.

### In a Node project

To use in a Node project, add GreaseTools as a dependency.

```sh
# npm
npm install greasetools

# yarn
yarn add greasetools
```

You can then import and use GreaseTools functions:

```javascript
import { valuesProxy, getValues } from 'greasetools'

const values = valuesProxy(
  await getValues({
    hello: 'World!',
  }),
)
```

### In a normal UserScript

In a UserScript that isn't built with Node.js, you can `@require` the library:

```javascript
// @require     https://gitlab.com/MysteryBlokHed/greasetools/-/raw/main/greasetools.user.js
```

You can replace `main` with a specific release tag like `v0.1.0` to require a specific version:

```javascript
// @require     https://gitlab.com/MysteryBlokHed/greasetools/-/raw/v0.1.0/greasetools.user.js
```

Functions are available on the global `GreaseTools` object:

```javascript
const { valuesProxy, getValues } = GreaseTools

const values = valuesProxy(
  await getValues({
    hello: 'World!',
  }),
)
```

#### Type declarations

The types included with the npm package still work when the library is `@require`'d.
Just add the types as a dev dependency for a Node project or install it globally.
With the package installed, include the following reference line somewhere in your TypeScript source file:

```typescript
/// <reference types="greasetools" />
```

## License

GreaseTools is licensed under either of

- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
  <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or
  <http://opensource.org/licenses/MIT>)

at your option.

[build badge]: https://img.shields.io/gitlab/pipeline-status/MysteryBlokHed/greasetools
[npm badge]: https://img.shields.io/npm/v/greasetools
[license badge]: https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-green

---
_Source: https://npm.io/package/greasetools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
