open-index/open-npm huggingface dataset:
npm package: @kwhitley/localstorify
Description: localStorage that avoids storage limit failures
Author: Kevin R. Whitley
Latest version: 0.2.0

localStorage that avoids storage limit failures
===

# Why?
Because localStorage is great, but extremely limited in functionality and robustness.  This library adds:
- [x] automatic garbage collection and limit detection (no failures on persistence)

# Installation
```
yarn add -D @kwhitley/localstorify
```

# Usage
Simply replace references to `localStorage` with the the export of this library.

```js
  import localstorify from '@kwhitley/localstorify'

  // replace
  localStorage.getItem('foo')
  // with
  localstorify.getItem('foo')

  ...

  // or
  localStorage.setItem('foo', JSON.stringify({ foo: 'bar' }))
  // with
  localstorify.setItem('foo', JSON.stringify({ foo: 'bar' }))
```
npm package: @kwhitley/use-store
Description: Cross-component, persistable useState() effect, without context
Author: Kevin R. Whitley
Latest version: 1.2.6

Cross-component, persistable useState() effect, without context
===

# Why?
Even with the advent of React hooks, cross-component shared state
is still being solved with either context/provider hooks (messy), or traditional
stores like redux/mobx (messier).  This store more or less mirrors the signature of
the incredibly elegant `useState()` hook, with optional local persistence built-in.

# Installation
```
yarn add -D @kwhitley/use-store
```

# API
### useStore(namespace, [initialValue=undefined], [options={}])
returns `[ value, setValue ]` pair, identical to `useState()` in React
```js
import { useStore } from '@kwhitley/use-store'

// must be called inside a React component
let [ value, setValue ] = useStore('foo')
// value = undefined
setValue(3)
// value = 3
```

###### Arguments
- `namespace` (string) **required** - this is the reference you'll share throughout the app for a specific value.  E.g. `useStore('myValue')`
- `initialValue` (anything) **optional** - optional default value which will be set by the first component that encounters this hook on a given namespace.  This will be ignored if persist is enabled and value found locally.
- `options` (object) **optional** - options for the hook (see below):
  - `persist` (boolean, default=false)

### globalStore.set(namespace, initialValue, options) // params identical to `useStore()` above
For manually setting initial values and persist options so individual components don't have to (also to solve race conditions)
```js
import { globalStore } from '@kwhitley/use-store'

globalStore.set('foo', 'bar', { persist: true })
```

# Example (Elaborate)
```js
  // ComponentA.js

  import React from 'react'
  import { useStore } from '@kwhitley/use-store'

  export default function ComponentA() {
    let [ value, setValue ] = useStore('myValue', 3)

    return (
      <div>ComponentA:value = { value }</div>

      <button onClick={() => setValue(value + 1)}>
        Increment
      </button>
    )
  }
```

```js
  // ComponentB.js

  import React from 'react'
  import { useStore } from '@kwhitley/use-store'
  import ComponentA from './ComponentA'

  export default function ComponentB() {
    let [ value, setValue ] = useStore('myValue', 3)

    return (
      <div>
        ComponentB:value = { value } // this will increment as ComponentA clicks are registered

        <ComponentA />
      </div>
    )
  }
```
npm package: @kwhitley/yarn-release
Description: Simplifies module releases to NPM via Yarn
Latest version: 1.9.1

Simplifies module releases to NPM via Yarn
===

# Why?
For simplifying the steps when publishing to NPM (especially if from a subfolder):
- copying the root package.json into the build folder
- cleaning it up to remove dev deps
- navigating into that folder
- incrementing the appropriate version number
- publishing
- making sure that version number makes it back down to the root project to keep it all in sync
- navigating back out to the root

# Installation
```
yarn add -D @kwhitley/yarn-release
```

# Exposed Commands
- Just one: `yarn release --major|minor|patch|type=[something] [options]`

### Options
```bash
--type            version type <major|minor|patch|alpha|beta|rc|etc>
--major           major release X.#.# for breaking changes, short for --type=major
--minor           minor release #.X.# non-breaking for feature additions
--patch           patch release #.#.X for patch fixes/tweaks
--src <dir>       directory to build/release from (default=root)
--dest <dir>      temporary build directory (default=./.dist)
--test            build, but do not publish (great for testing locally)
--nocleanup       leave build folder after publishing (great for testing locally)
--nopublish       do not publish new version to NPM
--public          equivalent to npm publish --access=public
--commit          adds unstaged changes (including package.json update) to git and commits
--push            includes --commit, while also doing a "git push" (assumes ref has been set up)
-s, --silent      asks no questions (automated)
-v, --verbose     writes a bunch of extra stuff to the console
-V, --version     output the version number
-h, --help        output usage information
```

### Example Usage (package.json)
```js
{
  "scripts": {
    "build": "do some stuff",
    "prerelease": "test some stuff",
    "release": "yarn build && release --src=build --push",
    "release:major": "yarn release - --major",
    "release:minor": "yarn release - --minor",
    "release:patch": "yarn release - --patch",
    "release:rc": "yarn release - --type=rc",
    "release:verify": "yarn release - --type=rc --verbose --test --nopublish --nocleanup"
  }
}
```

### Caveats
- This build will do a generic `yarn publish` without specific `--access=public` flag,
meaning it will default to private if it's never been published.  Solution is to publish once with that
flag set, then use `release` to maintain.