open-index/open-npm huggingface dataset:
npm package: @lostinbrittany/qr-esm
Description: Version ESM of qr.js
Latest version: 1.2.0

# qr-esm: An ESM version of qr.js, QR code generator in pure Javascript (2011)

This is a fairly ESM for producing QR code on the fly.

Originally developed by Kang Seonghoon <kang.seonghoon@mearie.org>, adapted to ESM by me.
npm package: @lostinbrittany/shortcuts
Description: A simple JavaScript module (ESM) for handling keyboard shortcuts, either globals or attached to DOM elements
Author: Horacio Gonzalez
Latest version: 1.1.2

Shortcuts (`@lostinbrittany/shortcuts`) is a simple JavaScript module (ESM) for handling keyboard shortcuts, either globals or attached to DOM elements.

It's licenced under MIT licence.

Shortcuts is a tiny library, less than 200 lines of code, weighting 4 kB before minification. It has support for keypress, keydown, and keyup events on specific keys, keyboard combinations, or key sequences.

> `@lostinbrittany/shortcuts` is heavily inspired by the great [Shortcuts](https://github.com/rickellis/Shortcuts) lib, with some bits of [Mousetrap](https://github.com/ccampbell/mousetrap) and [Keypress](http://dmauro.github.io/Keypress/)


## Getting started

1. Install Shortcuts via Npm:

    ```
    npm i @LostInBrittany/shortcuts
    ```

1. Import Shortcuts in your code:

    ```JavaScript
    import shortcuts from '@LostInBrittany/shortcuts';
    ```

1. Add some shortcuts

    ```JavaScript
    // A shortcut bound to document.body on the keydown event    
    shortcuts.add('a', () => console.log('a'));

    // A shortcut bound to an HTML element with id `myTarget` on the keydown event 
    let elem = document.querySelector('#myTarget'); 
    shortcuts.add('b', () => console.log('b'), elem);

    // A shortcut bound to document.body on the keyup event    
    shortcuts.add('c', () => console.log('c'), 'keyup');

    // A shortcut bound to an HTML element with id `myTarget` on the keyup event 
    let elem = document.querySelector('#myTarget'); 
    shortcuts.add('d', () => console.log('d'), {element: elem, eventType: 'keyup'});

    ```

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -m 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

[MIT License](http://opensource.org/licenses/MIT)
npm package: @losting/ls
Description: localStorage
Author: losting
Latest version: 3.1.0

# ls
Easy localStorage

## Usage
```sh
npm install @losting/ls

```

### ES Module
``` JavaScript
import * as ls from '@losting/ls';

set('name', 'admin');

// json data
set('data', {
  name: '张三',
  password: '12345678',
});

// Set expiration time and enable simple encryption.
set('password', '12345678', {
  expires: 1000 * 60 * 60 * 24 * 7,
  encrypt: true,
});

```

### CDN
``` html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>example page</title>
  <script src="https://unpkg.com/@losting/ls@3.0.0/dist/ls.iife.js"></script>
</head>
<body>
  <div id="app"></div>
  <script>
    window.$ls.set('key', 'value');
    // ...
  </script>
</body>
</html>
```


### setPrefix
``` JavaScript
import { setPrefix } from '@losting/ls';

// setPrefix(prefix: string)
setPrefix('__EXAMPLE_');

```

### set
``` JavaScript
import { set } from '@losting/ls';

// set(key: string, value: unknown, option?: { expires?: number, encrypt?: boolean })
set('key', 'value');
// or
set('key', 'value', {
  expires: 0, // 0 or undefined mean never expire. 3000 means expire after 3 seconds
  encrypt: false, // Whether to encrypt
});

```

### get
``` JavaScript
import { get } from '@losting/ls';

const value = get('key');

// use callback
const value = get('token', ({value, expires}) => {
  if (expires - Date.now() <= 1000 * 60 * 5) {
    // do something
    // return custom value
  }
  return value;
});

```

### remove
``` JavaScript
import { remove } from '@losting/ls';

// remove(key: string)
remove('key');

```

### clear
``` JavaScript
import { clear } from '@losting/ls';

clear();
```