# pastable

> 📦 A collection of pastable code gathered from past projects

Latest version **2.2.1** (published 2023-07-30) · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2023-07-30 |
| First published | 2022-05-15 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.x |
| Dependencies | 3 |
| Unpacked size | 392 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | Alexandre Stahmer |
| Maintainers | astahmer |
| Keywords | pastable, snippets, reusable, utils, tiny, lodash, gists, typescript, react |

## Links

- npm: https://www.npmjs.com/package/pastable
- Repository: https://github.com/astahmer/pastable
- Homepage: https://github.com/astahmer/pastable#readme
- Issues: https://github.com/astahmer/pastable/issues
- npm.io page: https://npm.io/package/pastable

## Dependencies (3)

- [type-fest](https://npm.io/package/type-fest.md) ^3.5.3
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.20.12
- [ts-toolbelt](https://npm.io/package/ts-toolbelt.md) ^9.6.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.2.1 (latest) — 2023-07-30
- 2.2.0 — 2023-02-10
- 2.1.1 — 2023-01-23
- 2.1.0 — 2023-01-21
- 2.0.13 — 2022-09-01
- 2.0.12 — 2022-08-31
- 2.0.11 — 2022-08-05
- 2.0.10 — 2022-07-19
- 2.0.8 — 2022-07-04
- 2.0.7 — 2022-07-02
- 2.0.6 — 2022-06-18
- 2.0.5 — 2022-06-10
- 2.0.4 — 2022-06-02
- 2.0.3 — 2022-06-02
- 2.0.2 — 2022-06-02
- … 2 more at https://npm.io/package/pastable/versions

## README

<h1 align="center">
  📦 A collection of pastable code gathered from past projects
</h1>

<br />

<p align="center">
  <a href="https://codecov.io/gh/astahmer/entity-routes">
    <img
      alt="Code coverage"
      src="https://codecov.io/gh/astahmer/entity-routes/branch/main/graph/badge.svg?token=N0YDUEVIWJ"
    />
  </a>
  <a href="https://twitter.com/astahmer_dev">
    <img
      alt="astahmer_dev Twitter"
      src="https://img.shields.io/twitter/follow/astahmer_dev?label=%40astahmer_dev&style=social"
    />
  </a>
</p>
<br />

## TL;DR

this package is meant mostly for myself.

[API]https://paka.dev/npm/pastable@2.0.13/api

```sh
pnpm i pastable
```

With 1 main & 5 specific entrypoints:

-   `"pastable"`: re-exports everything from utils+typings
-   `"pastable/utils"`
-   `"pastable/react"`
-   `"pastable/typings"`
-   `"pastable/machines"`
-   `"pastable/server"` everything that's commonly used server-side (= no browser APIs + no vendors like react/xstate)

```ts
import { useSelection } from "pastable";

//  or

import { useSelection } from "pastable/react";
```

## ⚡ Motivations

In every project I've been a part of, I've always ended up copy/pasting some part of a previous project that I had made generic, and moving from one project to another I just kept pasting it over and over.

So here we are, I made yet another multi-purpose-utils package !

## 🎨 Code style

It aims to be as generic as possible so that either the source can litteraly be pasted if you just need a couple of functions or you can install any specific package at some point.

100% written in Typescript, near 100% code coverage as a constant goal.

Feel free to contribute if you think there is space for one of your previous projects gems.

## ❤️ Built with

Packages are built with https://preconstruct.tools/ & tested with https://vitest.dev/, special thanks to their authors for those priceless gems !

# Package History

-   [v1 using yarn2 workspaces + custom build scripts](https://github.com/astahmer/pastable/commit/f0f5c0a069f15f4669b976d1f51c7ebe512426d2), had a shitload of single-file packages deployed to npm, each built with https://github.com/developit/microbundle & tested with https://github.com/lukeed/uvu, generated with [plop](https://www.npmjs.com/package/plop)
-   [v2 using pnpm + turborepo](https://github.com/astahmer/pastable/commit/edf6904e041060084920159de04e5889eb4b5425): less packages, still too many folders / complexity, spent way too much time making it work in any env (browser, server, both like when using earlier version of NextJS..)
-   [v3 (current) using pnpm + preconstruct](https://github.com/astahmer/pastable/commit/5542e1cd095dd26bf09aa8ef6d4f829f366db51d): flattened lots of folders, let preconstruct do the hard work, removed shitty react unit tests, deadcode, outdateds demo/docs sites, removed `@` alias to simplify the publish process, replaced uvu by vitest

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