open-index/open-npm huggingface dataset:
npm package: @jojy/event-bus
Description: A javascript eventBus
Author: jojy
Latest version: 1.0.0

## A javascript eventBus

### A quick example
```js
npm i @jojy/event-bus -S

import eventBus from '@jojy/event-bus';

// bind
eventBus.on('back', e => console.log(`1: ${e}`))
eventBus.on('back', e => console.log(`2: ${e}`), 1)  // just callback once
eventBus.on('back.pageA', e => console.log(`3: ${e}`))  // with namespace

// emit
eventBus.emit('back', 'test')
// 1: test  2: test  3: test

eventBus.emit('back', 'test')
// 1: test  3: test

eventBus.emit('back.pageA', 'test')
// 3: test

// unbound
eventBus.off('back.pageA')  // only unbound back.pageA
eventBus.off('back')  // unbound all back

```

### Method
- on(key, function, times)，subscribe message
- emit(key, data)，publish message
- off(key)，remove the subscription

### Introduction
- support namespace, use `key.namespace` as a key, just like Jquery on.
- can set callback times, for example: `eventBus.on(key, callback, 1)`, it will execute once only.
npm package: @jojy/react-slick
Description:  React port of slick carousel
Author: Kiran Abburi
Latest version: 0.29.1

### @jojy/react-slick

[![Backers on Open Collective](https://opencollective.com/react-slick/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/react-slick/sponsors/badge.svg)](#sponsors) [![Join the chat at https://gitter.im/akiran/react-slick](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/akiran/react-slick?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

##### Carousel component built with React. It is a react port of [slick carousel](http://kenwheeler.github.io/slick/). Different with react-slick, Fix images click repeat bind for #1257 use version 0.29.0

## [Documentation](http://react-slick.neostack.com)

### Installation

**npm**

```bash
npm install @jojy/react-slick --save
```

**yarn**

```bash
yarn add @jojy/react-slick
```

**Also install slick-carousel for css and font**

```bash
npm install slick-carousel

// Import css files
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
```

or add cdn link in your html

```html
<link
  rel="stylesheet"
  type="text/css"
  charset="UTF-8"
  href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"
/>
<link
  rel="stylesheet"
  type="text/css"
  href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
/>
```

### [PlayGround](https://codesandbox.io/s/ppwkk5l6xx)

### Example

```js
import React from "react";
import Slider from "@jojy/react-slick";

export default function SimpleSlider() {
  var settings = {
    dots: true,
    infinite: true,
    speed: 500,
    slidesToShow: 1,
    slidesToScroll: 1
  };
  return (
    <Slider {...settings}>
      <div>
        <h3>1</h3>
      </div>
      <div>
        <h3>2</h3>
      </div>
      <div>
        <h3>3</h3>
      </div>
      <div>
        <h3>4</h3>
      </div>
      <div>
        <h3>5</h3>
      </div>
      <div>
        <h3>6</h3>
      </div>
    </Slider>
  );
}
```

### Props

For all available props, go [here](https://react-slick.neostack.com/docs/api/).

### Methods

For all available methods, go [here](https://react-slick.neostack.com/docs/api#methods)

### Development

Want to run demos locally

```bash
git clone https://github.com/akiran/react-slick
cd react-slick
npm install
npm start
open http://localhost:8080
```

## Contributing

Please see the [contributing guidelines](./CONTRIBUTING.md)
npm package: @jojy/storage
Description: A simple storage
Author: jojy
Latest version: 1.0.3

## 简易设置LocalStorage的工具

### 安装和使用
```js
npm i @jojy/storage -S

import storage from '@jojy/storage';

storage.use('xxx.com');

storage.set('user', {name: 'abc', age: 25}, { expires: 3600 * 24 * 30 });
storage.get('user');

storage.set('isLogin', false, { namespace: 'xxx.com_web', expires: 3600 * 24 });
storage.get('isLogin', { namespace: 'xxx.com_web' });

// 注意storage.use()要在文件第一次引用时调用，如果不好确定第一次调用的地方，可以包装一下

import myStorage from '@jojy/storage';
myStorage.use('xxx');
export default myStorage;
```

### 方法
- use(namespace)，全局改变namespace
- set(key, val, opts)，设置key和val，可设置namespace和expires
- get(key, opts)，获取key的值
- remove(key, opts)，移除key
- has(key, opts)，是否设置key
- now()，返回10位时间戳

### 实现原理
- 以namespace为LocalStorage的key，数据集的JSON为value。格式：{ namespace: JSON.stringify({ key: { val, exp }, ... }) }
- 可全局设置默认的namespace，也可在方法中指定namespace。

### 功能
- namespace 默认值为 __def，可使用use()方法改变 全局 namespace。也可以在使用时，指定参数namespace
- expires 默认值为 31536000（一年），单位是 秒；expires <= 0，则永不过期。原则上数据都应该有过期时间。

### namespace使用场景
- 不同的项目使用同一个域名，可以设置不同namespace区分存储，防止key冲突
- 存储大数据时。所有数据都存入同一个namespace，如果有大数据建议使用单独的namespace来存储