open-index/open-npm huggingface dataset:
npm package: @lessworkjs/framework
Description: A nodejs based framework for serverless applications.
Author: William Bowman
Latest version: 0.0.51

[![npm](https://img.shields.io/npm/v/lesswork-framework.svg)](https://www.npmjs.com/package/lesswork-framework)
[![Build Status](https://travis-ci.org/lessworkjs/framework.svg?branch=master)](https://travis-ci.org/lessworkjs/framework)
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/lessworkjs/framework?branch=master&svg=true)](https://ci.appveyor.com/project/gcphost/framework)
[![Coverage Status](https://coveralls.io/repos/github/lessworkjs/framework/badge.svg?branch=master)](https://coveralls.io/github/lessworkjs/framework?branch=master)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flessworkjs%2Fframework.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flessworkjs%2Fframework?ref=badge_shield)

# lesswork-framework
A nodejs based framework for serverless applications.

# Official Website
Visit [lesswork.io](https://lesswork.io) for information on how to install and use this framework.

# Goal
The goal of this framework is to simplify the requirements to successfully build and deploy a nodejs based serverless application on aws.

* Testing
* Deployment
* Authorization
* Commands
* Responses 
* Database ORM
* Configs
* Environments
* Documentation

And more...
npm package: @lessworkjs/hashids
Description: hashids service provider for Lessworkjs or Adonisjs
Author: William Bowman
Latest version: 0.0.9

# Lessworkjs/Adonisjs Hashids
This is a hashids provider for the [lessworkjs](https://lesswork.io/) and [adonisjs](https://adonisjs.com/) frameworks.

# Installation
```bash 
npm i @lessworkjs/hashids
```

Register the provider and alias in your `config/app.js` file.

```js
const providers = [
  ...
  '@lessworkjs/hashids/providers/HashProvider',
];

```

# Configuration
By default your key will be `APP_KEY`.

You can adjust the configurations by creating the file `config/hashids.js`
```
module.exports = {
  key: 'secret',
  length: 5,
  alaphabet: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',
};
```

# Usage
See [hashids](https://www.npmjs.com/package/hashids) for full usage information.

```js
const Hashids = use('Hashids');

console.log(Hashids.encode(1));
```
npm package: @lessworkjs/optional
Description: Optionally load object parameters
Author: William Bowman
Latest version: 1.0.1

[![Coverage Status](https://coveralls.io/repos/github/lessworkjs/optional.js/badge.svg?branch=master)](https://coveralls.io/github/lessworkjs/optional.js?branch=master) 
[![Build Status](https://travis-ci.org/lessworkjs/optional.js.svg?branch=master)](https://travis-ci.org/lessworkjs/optional.js)

# Optional
Optionally load object parameters. Return the parameter or null.

Idea based off the Laravel [optional](https://laravel.com/docs/5.6/helpers#method-optional) helper.

# Install
```
npm i @lessworkjs/optional
```

# Example
```js
const optional = require('@lessworkjs/optional');

const users = [{
  name: 'Jane',
}, {
  name: 'John',
  address: {
    street: '101 Main St.',
  },
}];


console.log(optional(users[0].address).street);
// null

console.log(optional(users[1].address).street);
// 101 Main St.
``` 

You can also use an optional callback:
```js
const results = optional(users[0], user => ({
  name: user.name,
  address: {
    street: '202 Main St.',
  },
}));

console.log(results)
/**
 * {
      name: 'John',
      address: {
        street: '202 Main St.',
      },
    }
 */
```
npm package: @lessworkjs/pusher
Description: pusher service provider for Lessworkjs or Adonisjs
Author: William Bowman
Latest version: 0.0.9

# Lessworkjs/Adonisjs Pusher
This is a pusher provider for the [lessworkjs](https://lesswork.io/) and [adonisjs](https://adonisjs.com/) frameworks.

# Installation
```bash 
npm i @lessworkjs/pusher
```

Register the provider and alias in your `config/app.js` file.

```js
const providers = [
  ...
  '@lessworkjs/pusher/providers/PusherProvider',
];

```

Create `config/pusher.js`
```js
module.exports = {
  appId: env('PUSHER_APP_ID'),
  key: env('PUSHER_APP_KEY'),
  secret: env('PUSHER_APP_SECRET'),
  cluster: env('PUSHER_APP_CLUSTER')
};
```

Define the settings above in your `.env`
```
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET= 
PUSHER_APP_CLUSTER=
```


# Usage
See [pusher](https://www.npmjs.com/package/pusher) for full usage information.

```js
const Pusher = use('Pusher');

Pusher.trigger('channel-1', 'test_event', { message: "hello world" });
```
npm package: @lesterchn/csa
Description: Cross site accessor
Author: lester
Latest version: 1.0.1

# CsaAccessor iFrame/Frame 跨站/跨域访问器

## 初始化

```sh
yarn add @lesterchn/csa
npm i @lesterchn/csa
yarn add @lesterchn/csa
```

## 创建主站访问器

```ts
import { createMasterAccessor } from "@lesterchn/csa";

const master = createMasterAccessor({ el: "#frame" });

// 导出从站调用的方法
master.expose = {
  getMaster() {
    return `invoke getMaster`;
  },
  sayMaster(name: string) {
    return `master: ${name}`;
  },
};

// 连接成功后
master.ready(() => {
  console.log("slave 已准备好了");
  // 调用方法1
  console.log("调用getFrame返回值:", frame.call("getFrame"));
  // 调用方法2，并携带参数
  console.log("调用sayFrame返回值:", frame.call("sayFrame", "我是Master"));
  // 发送/推送普通消息
  frame.emit("frame:xxx", new Date().toLocaleDateString());
});

// 监听消息
master.on('master:xxx', (message: string) {
  console.log(message);
});

/** 监听一次性消息 */
master.on('master:xxx2', (message: string, args2: string) {
  /// todo
}, true)
```

## 创建从站访问器

```ts
import { createMasterAccessor } from "@lesterchn/csa";

const frame = createFrameAccessor();
// 到处主站调用的方法
frame.expose = {
  getFrame() {
    return `getSlave invoke`;
  },
  sayFrame(name: string) {
    return `frame: ${name}`;
  },
};

// 连接主站成功后回调
frame.ready(() => {
  console.log("slave 已准备好了");
  // 调用主站方法1
  console.log("调用getMaster返回值:", frame.call("getMaster"));
  // 调用主站方法2，并携带参数
  console.log("调用sayMaster返回值:", frame.call("sayMaster", "我是Frame"));
   // 发送/推送普通消息
  frame.emit("frame:xxx", new Date().toLocaleDateString());
});

// 监听消息
frame.on('frame:xxx', (message: string) {
  console.log(message);
});

/** 监听一次性消息 */
frame.on('frame:xxx2', (message: string, args2: string) {
  /// todo
}, true)
```

### 浏览器引用

```html
<script src="csa.umd.cjs"></script>
<script>
  const master = Csa.createMasterAccessor({ frame: "#frame" });
  // 导出方法
  master.expose = {
    getMaster() {
      return `invoke getMaster`;
    },
    sayMaster(name: string) {
      return `master: ${name}`;
    },
  };
</script>

<script>
  const frame = Csa.createFrameAccessor({});
  // 导出方法
  frame.expose = {
    getFrame() {
      return `getSlave invoke`;
    },
    sayFrame(name: string) {
      return `frame: ${name}`;
    },
  };
</script>
```
npm package: @lesterchn/monaco-editor
Description: + 已支持汉化 + 支持json/js/mysql语法 + worker目录 为webworker
Author: hemifeng@css.com.cn
Latest version: 0.1.1

# @lesterchn/monaco-editor
+ 已支持汉化
+ 支持json/js/mysql语法
+ worker目录 为webworker

> 1. JSON 案列
```javascript
import Vue from 'vue';

import { EditorWorker, JsonWorker, monaco } from '@lesterchn/monaco-editor';
import '@lesterchn/monaco-editor/dist/lib/style.css';

// @ts-ignore
self.MonacoEnvironment = {
  getWorker: function (_, label) {
    if (label === 'json') {
      return new JsonWorker()
    }
    return new EditorWorker()
  },
}

/** @type {Vue} */
export const QryApiJsonEditor = Vue.extend({
  name: 'QryApiJsonEditor',
  props: {
    readOnly: { type: Boolean, required: false },
    apiJson: { type: Object, default: () => ({ "$schema": `${location.origin}/apiJson/v2.json`, designConfig: {} }) },
  },
  render(h) {
    return h('div', { class: 'qry-api-json-editor' });
  },
  created() {
    // monaco.languages.registerDefinitionProvider()
    monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
      validate: true,
      schemas: [
        {
          uri: `${location.origin}/apiJson/v2.json`,
          schema: {
            type: 'object',
            description: '查询组件/查询配置/V2',
            properties: {
              queryCode: {
                description: '查询代码(queryCode)',
                type: 'string',
              },
              queryName: {
                title: '查询名称(queryName)',
                type: 'string'
              },
              version: {
                title: '版本(version)',
                description: '保留字段',
                type: 'number',
                exclusiveMinimum: 0
              },
            },
            required: [
              "queryCode"
            ]
          }
        }
      ]
    })

  },
  mounted() {


    const $editor = monaco.editor.create(this.$el, { language: "json", fontSize: 20 });
    this.$watch(() => JSON.stringify(this.apiJson, null, 2), (value) => {
      $editor.setValue(value);
    }, { immediate: true })
  }
})
```