open-index/open-npm huggingface dataset:
npm package: @puuru/puuru-hooks
Description: React hooks
Author: Bill Xiong
Latest version: 1.1.3

# PUURU Hooks

积累一些常用的 hooks

[TOC]

## `useDetectColorScheme`

监测浏览器的颜色是 light 或者 dark

```js
const colorScheme = useDetectColorScheme()
```

## `useLocalStorage`

方便序列化和反序列化 localStorage 数据的 hook

```js
const [account, setAccount] = useLocalStorage('account', {user: 'nobody'})

console.log(account.user)

setAccount({
    ...account,
    user: 'Bar'
})
```

## `useViewport`

监听 window 宽和高

index.jsx

```html
<ViewportProvider>
    <App />
</ViewportProvider>
```

App.jsx

```js
const App = () => {
    const { width, height } = useViewport()
    // now we get width and height of the view port in realtime
}
```

## `useWindow`

监听窗口的属性

- `visiable` 网页 Tab 是否为可见

例子

```js
const { visiable } = useWindow()
```
npm package: @puuuudding/decamelize-keys
Description: Convert object keys to lowercased one
Author: Sean J. Bao
Latest version: 6.2.2

# decamelize-keys

This project was forked from [`camelcase-keys`](https://github.com/sindresorhus/camelcase-keys) and converted to do the opposite. This project will keep updated with `camelcase-keys`.

> Convert object keys to lowercased one using [`decamelize`](https://github.com/sindresorhus/decamelize).

## Install

```
$ npm install @puuuudding/decamelize-keys
```

## Usage

```js
const decamelizeKeys = require('decamelize-keys');

// Convert an object
decamelizeKeys({fooBar: true});
//=> {'foo_bar': true}

// Convert an array of objects
decamelizeKeys([{fooBar: true}, {barFoo: false}]);
//=> [{'foo_bar': true}, {'bar_foo': false}]

decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
//=> {'foo_bar': true, nested: {'unicorn_rainbow': true}}

// Use custom separator
decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true, separator: '-'});
//=> {'foo-bar': true, nested: {'unicorn-rainbow': true}}
```

## API

### decamelizeKeys(input, options?)

#### input

Type: `object | object[]`

An object or array of objects to decamelize.

#### options

Type: `object`

##### exclude

Type: `Array<string | RegExp>`\
Default: `[]`

Exclude keys from being camel-cased.

##### stopPaths

Type: `string[]`\
Default: `[]`

Exclude children at the given object paths in dot-notation from being decamelize. For example, with an object like `{a: {b: '🦄'}}`, the object path to reach the unicorn is `'a.b'`.

```js
decamelizeKeys({
	aB: 1,
	aC: {
		cD: 1,
		cE: {
			eF: 1
		}
	}
}, {
	deep: true,
	stopPaths: [
		'aC.cE'
	]
})
/*
{
	a_b: 1,
	a_c: {
		c_d: 1,
		c_e: {
			eF: 1
		}
	}
}
*/
```

##### deep

Type: `boolean`\
Default: `false`

Recurse nested objects and objects in arrays.

##### separator

Type: `string`\
Default: `'_'`

Character or string inserted to separate words in key.

```js
const decamelize = require('decamelize');

decamelize('unicornRainbow');
//=> 'unicorn_rainbow'

decamelize('unicornRainbow', {separator: '-'});
//=> 'unicorn-rainbow'
```

##### preserveConsecutiveUppercase

Type: `boolean`\
Default: `false`

Preserve sequences of uppercase characters.

```js
const decamelize = require('decamelize');

decamelize('testGUILabel');
//=> 'test_gui_label'

decamelize('testGUILabel', {preserveConsecutiveUppercase: true});
//=> 'test_GUI_label'
```
## Related

See [`camelcase-keys`](https://github.com/sindresorhus/camelcase-keys) for the inverse.
npm package: @puxi/core
Description: Default set of PuxiJS UI display objects
Author: Shukant Pal
Latest version: 1.0.2

# @puxi/core

This module contains the base set UI display objects that PixiJS applications generally use.

## Install

```js
npm install @puxi/core
```

## Usage

```
import { Button, CheckBox } from '@puxi/core';
```