open-index/open-npm huggingface dataset:
npm package: @rschristian/wmr
Description: The tiny all-in-one development tool for modern web apps, in a single 2mb file with no dependencies.
Author: The Preact Authors
Latest version: 3.7.3

# WMR

[![npm](https://img.shields.io/npm/v/wmr.svg)](http://npm.im/wmr)
[![install size](https://packagephobia.com/badge?p=wmr)](https://packagephobia.com/result?p=wmr)
[![OpenCollective Backers](https://opencollective.com/preact/backers/badge.svg)](#backers)
[![OpenCollective Sponsors](https://opencollective.com/preact/sponsors/badge.svg)](#sponsors)

**The tiny all-in-one development tool for modern web apps**, in a single 2mb file with no dependencies.

All the features you'd expect and more, from development to production:

🔨 &nbsp; No entry points or pages to configure - just HTML files with `<script type=module>`<br>
🦦 &nbsp; Safely `import "packages"` from npm **_without installation_**<br>
📦 &nbsp; Smart bundling and caching for npm dependencies<br>
↻ &nbsp; Hot reloading for modules, Preact components and CSS<br>
⚡️ &nbsp; Lightning-fast JSX support that you can debug in the browser<br>
💄 &nbsp; Import CSS files and [CSS Modules](https://github.com/css-modules/css-modules) (`*.module.css`)<br>
🔩 &nbsp; Out-of-the-box support for [TypeScript](https://www.typescriptlang.org/)<br>
📂 &nbsp; Static file serving with hot reloading of CSS and images<br>
🗜 &nbsp; Highly optimized Rollup-based production output (`wmr build`)<br>
📑 &nbsp; Crawls and pre-renders your app's pages to static HTML at build time<br>
🏎 &nbsp; Built-in HTTP2 in dev and prod (`wmr serve --http2`)<br>
🔧 &nbsp; Supports [Rollup plugins](#configuration-and-plugins), even in development where Rollup isn't used

[Read the Docs to learn more.](https://wmr.dev/docs)
npm package: @rschubkegel/datacache
Description: A utility for manually caching data in a browser.
Author: Rylan Schubkegel
Latest version: 0.3.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# datacache

This package is intended for use with web apps that do the following:

1. Fetch a significant amount of data from APIs
2. Perform multiple modifications to that data before saving
3. Require data to be persistent between page navigation (or browser sessions)

This package uses _chunks_ to split data into collections. This reduces read/write overhead when only modifying small portions of a large collection of data.

For example, you may have a book writing web app where each chapter is saved in the cache as its own _chunk_.

## Installation

Install via npm:

```bash
npm i @rschubkegel/datacache
```

Install via yarn:

```bash
yarn add @rschubkegel/datacache
```

## Usage

### Import & setup

```js
import DataCache from '@rschubkegel/datacache';

const myDataCache = new DataCache(
  getData,    // typically GET request
  putData,    // typically PUT request
  deleteData, // typically DELETE
  'my-data',  // prefix for keys in storage where data saved
  window.sessionStorage // can by any object with Storage interface
);
```

### Fetch data

```js
// first call fetches data from API
await myDataCache
  .getChunk('first-item')
  .then(data => console.log('Data received:', data));

// second call (and subsequent calls) gets data from cache
let data = await myDataCache.getChunk('first-item');
```

### Modify & save data

```js
// data can be saved to local cache to reduce API calls
myDataCache.saveLocalChunk('first-item', {...data, newProperty: 'Hello world!'});

// user can freely navigate to & from other pages
// without losing the changes saved locally
window.location.replace('/other-page');
window.location.replace('/original-page');

// when all modifications have completed, the data can be
// saved back to the server (only requires one API call!)
myDataCache.saveChunk('first-item', data);
```