open-index/open-npm huggingface dataset:
npm package: @marshal93/cookie
Description: Cookie
Author: marshal93
Latest version: 1.1.2

# INSTALL

```bash
npm i @marshal93/cookie -S
```

====

## API

### getAllCookies

获取当前页面可以访问到的全部 cookie。

```typescript
function getAllCookies(): object;
```

### getCookie

获取单个 cookie

```typescript
function getCookie(name: string): string | undefined;
```

### setCookie

设置 cookie，设置 cookie，默认为时间为 180 天，设置 extra.days 为 0 可以保存为 session cookie（expires 为空）

```typescript
function setCookie(name: string, value: string, extra: {
  domain?: string; // 默认为当前页面的二级域名，如 `.baidu.com`，如果是 IP 则为 IP，如 `127.0.0.1`
  path?: string; // 默认 '/'
  days?: number; // 默认 180，传入 `days: 0` 成为 session cookie
  encoding?: boolean; // 默认 true，传入 `false` 可保存原始的值（比如 value 已经经过 base64 编码过）
} = {}): void;
```

### deleteCookie

删除 cookie，其实设置一个过期时间为此刻之前的时间，浏览器会自动清理过期的 cookie

```typescript
function deleteCookie(name: string, extra: {
  domain?: string;
  path?: string;
} = {}): void;
```
npm package: @marshal93/copy-text
Description: 复制文本
Author: marshal93
Latest version: 1.1.3

copy-text
===

最简单的复制文本工具方法

# INSTALL

```
npm i /@marshal93/copy-text -S
```

# API

```typescript
import copyText from '@marshal93/copy-text';

copyText(...some...text...);
```

可以用 `import { COPY_SUPPORTED } from '@marshal93/copy-text;` 做预先判断是否支持复制功能。
npm package: @marshal93/mobile-utils
Description: Storage - use mobile-utils with types
Author: marshal93
Latest version: 0.1.1

# @marshal93/mobile-utils

手机端常用基础工具

## EXAMPLE

```js
import {
  env,
  setTitle,
  isCarLicense,
  isEmail,
  isMobile,
  isPhone,
  isIDCard
} from '@marshal93/mobile-utils';

// 安卓环境
env.isAndroid();
// IOS 环境
env.isIOS();
// 微信环境
env.isWeChat();
// 微信小程序环境
env.isWxMiniprogram();
// 百度小程序环境
env.isBaiduMiniprogram();
// 头条环境
env.isToutiao();
// 钉钉环境
env.isDingTalk();
// 设置 title
setTitle('设置 title');
// 检验邮箱
isEmail('marshal93@163.com');
// 校验手机号
isMobile('15656565656');
// 校验电话
isPhone('010-0000001')
// 校验车牌号
isCarLicense('浙ES9999')
// 校验身份证号
isIDCard('110101199001019239')
// 判断是否支持 webp
checkWebp()
```
npm package: @marshal93/random-string
Description: Storage - use random-string with types
Author: marshal93
Latest version: 0.1.1

# @marshal93/random-string

获取一个随机字符串，默认获取 6 位字符，默认字符集合 `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`

## EXAMPLE

使用
```js
import randomString from '@marshal93/random-string';

randomString();
// 更改长度
randomString(2);
// 更改长度和随机集合
randomString(3, '0123456789');
```
npm package: @marshal93/storage
Description: Storage - use storage with types
Author: marshal93
Latest version: 1.1.3

# @marshal93/storage

一个应用最好有自己的一个 storage 的主 key 作为其统一的 namespace 对 storage 下的字段进行管理，有如下好处：

- 避免 localStorage / sessionStorage 的泛滥
- 避免应用内取名冲突
- 可以存取各种类型的数据，而不是需要转换过才能用的字符串
- 不必担心出错

## API

这是一个工厂方法，生产一个方法：

```js
import storageFactory from '@marshal93/storage';

export default storageFactory(`${app_name}@${user_id}`); // 最好能跟登录用户挂钩，默认用的是 locationStorage

// 如果还需要 sessionStorage 的操作，可以这样：
export const session = storageFactory(`${app_name}@${user_id}`, true);
```

工厂方法生产出来的方法是多态的：

```typescript
// 获取全部，没有什么实际意义，只在 debug 时可以用
function storage(): Record<string, unknown>;

// 获取 key 对应的值
export interface IFnStorageGetter {
  <T = string>(key: string): T;
}

// 删除 key 对应的值
export interface IFnStorageClearer {
  (key: string, value: null): void;
}

// 设置 key 对应的值
export interface IFnStorageSetter {
  <T = string>(key: string, value: T): void;
}
```

## EXAMPLE

1.在应用下生产「唯一」的 storage 模块，比如 `util/storage.js`

```js
import storageFactory from '@marshal93/storage';

export default storageFactory(`${app_name}@${user_id}`); // 最好能跟登录用户挂钩，默认用的是 locationStorage

// 如果还需要 sessionStorage 的操作，可以这样：
export const session = storageFactory(`${app_name}@${user_id}`, true);
```

2.使用

```js
import storage from ':util/storage';

storage(); // 获取全部，没有什么实际意义
storage(key); // 获取某个值
storage(key, val); // 设置某值
storage(key, null); // 清除某值
```
npm package: @marshal93/stylelint-config
Description: stylelint-config
Author: marshal93
Latest version: 1.0.3

# @marshal93/stylelint-config

* [stylelint](http://stylelint.cn/)
* [stylelint-config-standard](https://www.npmjs.com/package/stylelint-config-standard)
* [stylelint-order](https://www.npmjs.com/package/stylelint-order)
* [stylelint-config-recommended-vue](https://www.npmjs.com/package/stylelint-config-recommended-vue)


## INSTALL

```shell
npm i -D stylelint @marshal93/stylelint-config
```

## Usage

根目录下新建 `.stylelintrc`

### 通用

```json
{
  "extends": [
    "@marshal93/stylelint-config"
  ]
}
```

### vue 项目

按需自行安装 `less` 或 `scss`。需要确保项目已经安装 [vue-style-loader](https://www.npmjs.com/package/vue-style-loader) 包。

```json
{
  "extends": [
    "@marshal93/stylelint-config/vue"
  ]
}
```

在 `package.json` 里的 `"scripts"` 里添加 `lint:style`

```json
{
  "scripts": {
    "lint:style": "stylelint \"src/**/*.{less,css,sass,scss}\""
  }
}
```

在项目根目录下执行 `yarn lint:style` 或 `npm run lint:style`
npm package: @marshal93/vue-directives
Description: vue-directives with types
Author: marshal93
Latest version: 0.1.1

# @marshal93/vue-directives
===

# INSTALL

```
npm i @marshal93/vue-directives -S
```

# Usage
```js
import Vue from 'vue';
import Directives from '@marshal93/vue-directives';

/**
 * 挂载到全局组件
 * @param {Object} options - 设置默认值 
 * @param {number} [options.x=50] - x position
 * @param {number} [options.y=100] - y position
 * @param {number} [options.langTapTimer=1000] - 长按按钮触发时间
 */
Vue.use(Directives, {
  x: 200,
  y: 300,
  langTapTimer: 500
})

// Api
<button v-tap="handle">点击</button>
<button v-swipe="handle">滑动</button>
<button v-swipeLeft="handle">左滑</button>
<button v-swipeRight="handle">右滑</button>
<button v-swipeUp="handle">上滑</button>
<button v-swipeDown="handle">下滑</button>
<button v-longTap="handle">长按</button>

/**
 * stop 阻止冒泡
  prevent 阻止默认事件
  self 只当在 event.target 是当前元素自身时触发处理函数
  once 执行一次后解绑
 */
<button v-tap.stop.prevent.self.once="handle">修饰符</button>

```
npm package: @marshallofsound/electron-not-down-load
Description: Utility for downloading different versions of Electron
Author: Samuel Attard
Latest version: 0.0.1

# @electron/download

> Download Electron release artifacts

## Usage

### Simple: Downloading an Electron Binary ZIP

```js
import { downloadElectron } from '@electron/download';

const zipFilePath = await downloadElectron('4.0.4');
```

### Advanced: Downloading a macOS Electron Symbol File


```js
import { downloadElectron } from '@electron/download';

const zipFilePath = await downloadElectron({
  version: '4.0.4',
  platform: 'darwin',
  assetName: 'electron',
  assetSuffix: 'symbols',
  arch: 'x64',
});
```

## How It Works

This module downloads Electron to a known place on your system and caches it
so that future requests for that asset can be returned instantly.  The cache
locations are:

* Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`
* MacOS: `~/Library/Caches/electron/`
* Windows: `%LOCALAPPDATA%/electron/Cache` or `~/AppData/Local/electron/Cache/`
npm package: @marshallofsound/macos-notification-state
Description: macOS notification state as a native node addon
Author: Felix Rieseberg
Latest version: 1.3.5

## macos-notification-state
Do you want to check if you should display a notification to your user on macOS? This native module checks if the user is active, if the screen is locked, or if "do not disturb" is enabled.

```
npm install macos-notification-state
```

```
const { getNotificationState, getSessionState, getDoNotDisturb } = require('macos-notification-state`)

// This will brint a boolean (true if enabled, false if not)
console.log(getDoNotDisturb())

// This will print a string indiciating the current state, being one of the following:
// 'SESSION_SCREEN_IS_LOCKED'
// 'SESSION_ON_CONSOLE_KEY'
// 'DO_NOT_DISTURB'
// 'UNKNOWN'
// 'UNKNOWN_ERROR'
//
// If "do not disturb" is enabled, it takes precedence.
console.log(getNotificationState())

// This will print a string indiciating the current session state, being one of the following:
// 'SESSION_SCREEN_IS_LOCKED'
// 'SESSION_ON_CONSOLE_KEY'
// 'UNKNOWN'
console.log(getSessionState())
```

#### License
MIT, please see LICENSE for details. Copyright (c) 2019 Felix Rieseberg.
npm package: @marshallofsound/mocha-appveyor-reporter
Description: Mocha Reporter to report tests while running in AppVeyor CI
Author: Nathan Black
Latest version: 0.4.3

### Mocha reporter for AppVeyor

Report your test results to AppVeyor's testing infrastructure.

[![Build status](https://ci.appveyor.com/api/projects/status/ddacjc9dr7w2iqfw/branch/master?svg=true)](https://ci.appveyor.com/project/tolbertam/mocha-appveyor-reporter/branch/master) [![Build Status](https://travis-ci.org/tolbertam/mocha-appveyor-reporter.svg?branch=master)](https://travis-ci.org/tolbertam/mocha-appveyor-reporter)

See it [in action](https://ci.appveyor.com/project/tolbertam/mocha-appveyor-reporter/build/tests) with this repository.

### Install

```
npm install --save-dev mocha-appveyor-reporter
```

#### Usage

```
mocha --reporter mocha-appveyor-reporter
```

#### Options

This reporter is configurable via use of `--reporter-options` or by setting environment variables.

|Reporter Option          |Environment Variable             |Default                                                  |
|-------------------------|---------------------------------|---------------------------------------------------------|
|appveyorBatchSize        |APPVEYOR\_BATCH\_SIZE            |100                                                      |
|appveyorBatchIntervalInMs|APPVEYOR\_BATCH\_INTERVAL\_IN\_MS|1000                                                     |
|appveyorApiUrl           |APPVEYOR\_API\_URL               |unset, but AppVeyor sets the environment variable for you|

The reporter will by default batch and send tests in an API call to AppVeyor for every 100 tests completed or 1000ms
elapsed (whichever happens first).

To override this behavior you may do the following:

```
mocha --reporter mocha-appveyor-reporter --reporter-options appveyorBatchSize=1
```
npm package: @marshallswain/events
Description: Node's event emitter for all engines.
Author: Irakli Gozalishvili
Latest version: 3.1.1

# events [![Build Status](https://travis-ci.org/Gozala/events.png?branch=master)](https://travis-ci.org/Gozala/events)

> Node's event emitter for all engines. This is the same as the `events` package in Node except it is published under a new name for better compatibility with the Vite server. Vite currently throws an error for Node's build-ins because Vite supports browser modules.

This implements the Node.js [`events`](http://nodejs.org/api/events.html) module for environments that do not have it, like browsers.

> `events` currently matches the **Node.js 11.12.0** API.

Note that the `events` module uses ES5 features. If you need to support very old browsers like IE8, use a shim like [`es5-shim`](https://www.npmjs.com/package/es5-shim). You need both the shim and the sham versions of `es5-shim`.

This module is maintained, but only by very few people. If you'd like to help, let us know in the [Maintainer Needed](https://github.com/Gozala/events/issues/43) issue!

## Install

You usually do not have to install `events` yourself! If your code runs in Node.js, `events` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) also include the `events` module.

But if none of those apply, with npm do:

```
npm install events
```

## Usage

```javascript
var EventEmitter = require('events')

var ee = new EventEmitter()
ee.on('message', function (text) {
  console.log(text)
})
ee.emit('message', 'hello world')
```

## API

See the [Node.js EventEmitter docs](http://nodejs.org/api/events.html). `events` currently matches the Node.js 11.12.0 API.

## Contributing

PRs are very welcome! The main way to contribute to `events` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `events` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.

If there is a difference in behaviour between Node.js's `events` module and this module, please open an issue!

## License

[MIT](./LICENSE)