open-index/open-npm huggingface dataset:
npm package: @noriaki/linebot
Description: LINE BOT API wrapper for Node.js
Author: 3846masa
Latest version: 0.2.2

@3846masa/linebot
=================

LINE BOT API wrapper for Node.js

------

[![NPM][npm-badge]][npm]
[![LICENSE][license-badge]][license]
[![dependencies][dependencies-badge]][dependencies-david]

[npm]: https://www.npmjs.com/package/@3846masa/linebot
[license]: https://3846masa.mit-license.org
[dependencies-david]: https://david-dm.org/3846masa/linebot?view=list

[npm-badge]: https://img.shields.io/npm/v/@3846masa/linebot.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURcwAAOeIiP////G7u/ri4tIZGdpFReJsbPC3t075sZwAAAAvSURBVCjPY2CgDWAThIMEsACjEhwIUCZg0dGCIqASwMAxMgXAgSzOwMAOC2TqAwBvzR4JxLaP0gAAAABJRU5ErkJggg==
[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAIGNIUk0AAHomAACAhAAA%2BgAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAVUExURSBTICJcIiNgIiZoJTuhNyt3Kf///%2BCqxSgAAAAGdFJOUwpclbn%2B4Fj6/H8AAAABYktHRAZhZrh9AAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4AkEEjEV7MDQQwAAAGBJREFUCNc1TUEKgDAMi07vE/Q%2BRD8g%2B4BbvAvi/79iMjDQJm1CC6BbDzRsZI3incIpYeYFhCaYnLiyPYnYkwWZFWoFHrSuttCmmbwXh0eJQYVON4JthZTxCzzAmyb8%2BAAKXBRyN6RyZQAAAABJRU5ErkJggg==
[dependencies-badge]: https://img.shields.io/david/3846masa/linebot.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAbUExURcwAAOeIiP////G7u/ri4tIZGdpFReJsbPC3t075sZwAAAAvSURBVCjPY2CgDWAThIMEsACjEhwIUCZg0dGCIqASwMAxMgXAgSzOwMAOC2TqAwBvzR4JxLaP0gAAAABJRU5ErkJggg==

## Docs

https://3846masa.github.io/node-linebot/

## Install

```sh
npm install --save @3846masa/linebot
```

## Usage

```javascript
const LineBot = require('@3846masa/linebot/lib/LineBot').LineBot;

const bot = new LineBot({
  channelSecret: 'XXXXXXXXXX',
  channelToken: 'XXXXXXXXXX',
});

bot.on('webhook:*', (ev) => {
  console.log('You got a event!', ev);
});

bot.on('webhook:message', (ev) => {
  const message = ev.message;
  ev.reply(message);
});

bot.listen(process.env.PORT || 3000);
```

See [examples](./examples).

## LICENSE

MIT (c) 3846masa

## Author

![3846masa][3846masa] 3846masa

[3846masa]: https://gravatar.com/avatar/cfeae69aae4f4fc102960f01d35d2d86?s=25
npm package: @noriaki/npm-run-all
Description: A CLI tool to run multiple npm-scripts in parallel or sequential.
Author: Toru Nagashima
Latest version: 3.1.4

| index | [npm-run-all] | [run-s] | [run-p] | [Node API] |
|-------|---------------|---------|---------|------------|

# npm-run-all

[![npm version](https://img.shields.io/npm/v/npm-run-all.svg)](https://www.npmjs.com/package/npm-run-all)
[![Downloads/month](https://img.shields.io/npm/dm/npm-run-all.svg)](http://www.npmtrends.com/npm-run-all)
[![Build Status](https://travis-ci.org/mysticatea/npm-run-all.svg?branch=master)](https://travis-ci.org/mysticatea/npm-run-all)
[![Build status](https://ci.appveyor.com/api/projects/status/v0owd44q1r7hceir/branch/master?svg=true)](https://ci.appveyor.com/project/mysticatea/npm-run-all/branch/master)
[![Coverage Status](https://coveralls.io/repos/mysticatea/npm-run-all/badge.svg?branch=master&service=github)](https://coveralls.io/github/mysticatea/npm-run-all?branch=master)
[![Dependency Status](https://david-dm.org/mysticatea/npm-run-all.svg)](https://david-dm.org/mysticatea/npm-run-all)

A CLI tool to run multiple npm-scripts in parallel or sequential.

```
$ npm-run-all clean lint build:*
```

```
$ npm-run-all --parallel watch:*
```

## Installation

```
$ npm install npm-run-all
```

- Requires `Node@>=0.10` and `npm@>=2`
- The `npm-run-all` package introduces 3 CLI commands: `npm-run-all`, `run-s`, and `run-p`.

## CLI Commands

This `npm-run-all` package provides 3 CLI commands.

- [npm-run-all]
- [run-s]
- [run-p]

The main command is [npm-run-all].
We can make complex plans with [npm-run-all] command.

Both [run-s] and [run-p] are shorthand commands.
[run-s] is for sequential, [run-p] is for parallel.
We can make simple plans with those commands.

## Node API

This `npm-run-all` package provides Node API.

- [Node API]

## Changelog

- https://github.com/mysticatea/npm-run-all/releases

## Contributing

Thank you for contributing!

### Bug Reports or Feature Requests

Please use GitHub Issues.

### Correct Documents

Please use GitHub Pull Requests.

I'm not familiar with English, so I especially thank you for documents' corrections.

### Feature Implementing

Please use GitHub Pull Requests.

There are some npm-scripts to help developments.
Those work on Windows, Mac, or Linux (by the way, I'm developping `npm-run-all` on Windows).

- **npm test** - Run tests and collect coverage.
- **npm run build** - Make `lib` directory from `src` directory.
- **npm run clean** - Delete directories (folders) which are created by other commands.
- **npm run lint** - Run ESLint.
- **npm run watch** - Run tests (not collect coverage) when each file was modified.

[npm-run-all]: docs/npm-run-all.md
[run-s]: docs/run-s.md
[run-p]: docs/run-p.md
[Node API]: docs/node-api.md
npm package: @noriaki/react-iframe-resizer
Description: iframe component enhanced by iframe-resizer
Author: James Canning
Latest version: 2.0.1

# react-iframe-resizer

`<iframe>` compontent that initialises with iframe-resizer.

## Attributes

### id
Required. Type: `string`

Unique iframe ID used by iframe-resizer.

## options
Optional. Type `object`

Options object passed directly to iframe-resizer on initialisation. See iframe-resizer's options.

## iframe attributes

All other attributes are passed through to the actual `<iframe>` component.
npm package: @noriginmedia/norigin-spatial-navigation-core
Description: Core spatial navigation logic for web and TV.
Author: Norigin Media
Latest version: 3.0.0

# Norigin Spatial Navigation Core

Norigin Spatial Navigation Core is a framework-agnostic module providing the logic for spatial navigation in TV applications.

For more detailed documentation and usage examples, visit our [Developer Portal](https://devportal.noriginmedia.com/docs/Norigin-Spatial-Navigation/)
npm package: @noriginmedia/norigin-spatial-navigation-react
Description: React hooks based Spatial Navigation solution
Author: Norigin Media
Latest version: 3.0.0

# Norigin Spatial Navigation React

Norigin Spatial Navigation React is a React-specific module providing the hooks for spatial navigation in TV applications.

For more detailed documentation and usage examples, visit our [Developer Portal](https://devportal.noriginmedia.com/docs/Norigin-Spatial-Navigation/)
npm package: @noritama/renovate-config
Description: Shareable config for Renovate (renovatebot.com)
Author: noritama
Latest version: 1.0.0

# @noritama/renovate-config

[Shareable config](https://renovatebot.com/docs/config-presets/) for [Renovate](https://renovatebot.com)

## Setup

Enable Renovate in your repo and just `extends` in `renovate.json`.

```json5
{
  "extends": ["@noritama"]
}
```

Note: Don't have to do `npm i -D @noritama/renovate-config`

## References

- [Renovate Docs](https://renovatebot.com/docs/)
- [Configuration Options \| Renovate Docs](https://renovatebot.com/docs/configuration-options/)
- [Default Presets \| Renovate Docs](https://renovatebot.com/docs/presets-default/)

## License

MIT
npm package: @norith/glimmer-blueprint
Description: Ember CLI blueprint for initializing a new Glimmer application.
Author: Tom Dale
Latest version: 1.0.2

# @glimmer/blueprint

[![npm version](https://badge.fury.io/js/%40glimmer%2Fblueprint.svg)](https://badge.fury.io/js/%40glimmer%2Fblueprint)

This repository holds the blueprint for generating a new Glimmer project.

To generate a project using this blueprint:

```bash
npx ember-cli new hello-glimmer --blueprint @glimmer/blueprint
```
npm package: @norith/glimmer-component
Description: Glimmer component library
Latest version: 1.0.2

# @glimmer/component

[![npm version](https://badge.fury.io/js/%40glimmer%2Fcomponent.svg)](https://badge.fury.io/js/%40glimmer%2Fcomponent)
[![CI](https://github.com/glimmerjs/glimmer.js/workflows/CI/badge.svg)](https://github.com/glimmerjs/glimmer.js/actions?query=workflow%3ACI)

## Installation

Add this package to your project with Yarn:

```bash
yarn add @glimmer/component
```

Or alternatively with npm:

```bash
npm install --save-dev @glimmer/component
```

## Usage

To use this in a Glimmer application, import the package and export an extended class:

```ts
import Component from '@glimmer/component';

export default class MyComponent extends Component {
}
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/glimmerjs/glimmer.js.

## Acknowledgements

Thanks to [Monegraph](http://monegraph.com) for funding the initial development
of this library.

## License

MIT License.
npm package: @norith/glimmer-ssr
Description: Server-side rendering for Glimmer Applications
Latest version: 1.0.2

# API Usage

```js
import { setComponentTemplate } from '@glimmer/core';
import component from '@glimmer/component';
import { renderToString } from '@glimmer/ssr';

import { templateFactory } from '@glimmer/opcode-compiler';
import { precompile } from '@glimmer/compiler';

let GlimmerComponent = component.default;

class PageComponent extends GlimmerComponent {}

let template = `
  {{#let "hello" "world" as |hello world|}}<p>{{hello}} {{world}}</p>{{/let}}
`;

setComponentTemplate(
  templateFactory(JSON.parse(precompile(template, { strictMode: true }))),
  PageComponent
);

// Print <p>hello world</p> to console:
console.log(await renderToString(PageComponent, {
  owner: {
    services: {}
  },
}));
```
npm package: @norith/glimmer-tracking
Description: Glimmer property tracking library
Latest version: 1.0.2

# @glimmer/tracking

[![npm version](https://badge.fury.io/js/%40glimmer%2Ftracking.svg)](https://badge.fury.io/js/%40glimmer%2Ftracking)
[![CI](https://github.com/glimmerjs/glimmer.js/workflows/CI/badge.svg)](https://github.com/glimmerjs/glimmer.js/actions?query=workflow%3ACI)

## Installation

Add this package to your project with Yarn:

```bash
yarn add -D @glimmer/tracking
```

Or alternatively with npm:

```bash
npm install --save-dev @glimmer/tracking
```

## Usage

To use this in a Glimmer application, import the package and export an extended class:

```ts
import Component from '@glimmer/component';
import { tracked } from '@glimmer/tracking';

export default class MyComponent extends Component {
  @tracked foo;
}
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/glimmerjs/glimmer.js.

## Acknowledgements

Thanks to [Monegraph](http://monegraph.com) for funding the initial development
of this library.

## License

MIT License.
npm package: @norith/glimmerx-blueprint
Description: Ember CLI blueprint for initializing a new GlimmerX application.
Author: Tom Dale
Latest version: 1.0.11

# @glimmerx/blueprint

[![npm version](https://badge.fury.io/js/%40glimmerx%2Fblueprint.svg)](https://badge.fury.io/js/%40glimmerx%2Fblueprint)

This repository holds the blueprint for generating a new GlimmerX project.

To generate a project using this blueprint:

```bash
npx ember-cli new hello-glimmer --blueprint @glimmerx/blueprint
```
npm package: @norith/glimmerx-eslint-plugin
Description: ESLint Plugin to enable and streamline glimmerx development
Author: Kyle Blomquist
Latest version: 1.0.11

# @glimmerx/eslint-plugin

## Background

[ESLint](https://eslint.org/docs/about) is an open source JavaScript [linting](https://en.wikipedia.org/wiki/Lint_\(software\)) utility.

## Introduction

This project exists to provide ESLint rules that either:
- fix issues between inline templates and the core ESLint rules
- Enable enhanced development experience for GlimmerX component authors/maintainers

## Installation and Usage

```
yarn add -D @glimmerx/eslint-plugin
```

For configuration, ESLint generally uses files named `.eslintrc.json` or `.eslintrc.js`.
The examples in this README will use js syntax, but you can read [the configuration docs for ESLint](https://eslint.org/docs/user-guide/configuring) for information on other formats / methods

To enable the Plugin, you will need to add the `@glimmerx` plugin to your list of plugins:
```js
module.exports = {
  plugins: [
    // ...existing plugins, if any
    '@glimmerx'
  ],
  // ...Other configuration settings
}
```

You will also need to enable any rules in the list of rules present in that same configuration. For example, if you wanted to use the rule `@glimmerx/template-vars`:
```js
module.exports = {
  plugins: [
    // ...existing plugins, if any
    '@glimmerx'
  ],
  // ...Other configuration settings
  rules: {
    '@glimmerx/template-vars': 'error'
  }
}
```

For details on what specific rules do and full configuration options, refer to [The Rules Docs](docs/rules)

## Development

For information on developing ESLint rules, see [the ESLint Rule Development Documentation](https://eslint.org/docs/developer-guide/working-with-rules)

### Testing

Testing is done by mocha and (when possible) uses [ESLint's built-in RuleTester](https://eslint.org/docs/developer-guide/nodejs-api#ruletester)
```
yarn test
```
npm package: @norith/glimmerx-prettier-plugin-component-templates
Description: A prettier formatter for glimmer component templates
Author: Matt Edwards
Latest version: 1.0.11

# @glimmerx/prettier-plugin-component-templates

## Background

[Prettier](https://prettier.io/docs/en/index.html) is an opinionated code formatter. In Prettier `>2.0` there is support for `*.hbs` glimmer files, but does not support the experimental syntaxes that `glimmerx` components are authored in.

## Introduction

This plugin extends the internal printers to add an embedded syntax for glimmer template in an `hbs` TaggedTemplateExpressions.

## Installation and Usage

```bash
yarn add -D @glimmerx/prettier-plugin-component-templates
```

Once added prettier will discover and use the plugin to format any `hbs` tagged template expression.

### Options

In your prettier config options (e.g. `.prettierrc`, `prettier.config.js`, etc.)

`.prettierrc`

```json
{
  "hbsSingleQuote": true
}
```

Defaults to `false` forcing double-quotes for all attributes in an hbs embed. When `true` will rewrite all quotes to single-quotes.

## Development

Generate a test case, add it to the tests file,

Add `PRETTIER_DEBUG=true` to the environment when running the plugin in order to get complete stack traces on errors.

### Debugging

#### Debugging

```
PRETTIER_DEBUG=true node --inspect-brk  node_modules/.bin/prettier --config=./test/fixtures/basic/config.js ./test/fixtures/basic/code.js
```

### Generate a snapshot

```
node node_modules/.bin/prettier --ignore-path --config=./test/fixtures/simple-formatted/config.js ./test/fixtures/simple-formatted/code.js > ./test/fixtures/simple-formatted/output.js
```

### Testing

#### Run all tests

```
yarn test
```

## TODO

- [ ] Add support for `<template>` tag semantics.
npm package: @norith/glint-core
Description: A CLI for performing typechecking on Glimmer templates
Author: Dan Freeman
Latest version: 1.0.1

# `@glint/core`

This package contains core functionality to power template-aware typechecking on a [glint] project.

[glint]: https://github.com/typed-ember/glint

## CLI

### Usage

```sh
glint [--watch|-w] [--declaration|-d] [--project path/to/tsconfig.json]
```

### Flags

- `--watch` If passed, `glint` will perform a watched typecheck, re-checking your project as files change.
- `--declaration` If passed, `glint` will emit `.d.ts` files according to the configuration in your `tsconfig.json`
- `--project` Overrides where `glint` will look to find your project's `tsconfig.json`
npm package: @norith/glint-environment-glimmerx
Description: A Glint environment to support GlimmerX projects
Author: Dan Freeman
Latest version: 1.0.1

# `@glint/environment-glimmerx`

This package contains the information necessary for glint to typecheck a [glimmer-experimental](https://github.com/glimmerjs/glimmer-experimental) project.

See [the Glint documentation](https://typed-ember.gitbook.io/glint/using-glint/glimmerx/installation) for more detailed instructions on working with GlimmerX projects in Glint.
npm package: @norith/glint-scripts
Description: Scripts for working with Glint
Latest version: 1.0.1

# Glint scripts

A handful of tools for working with Glint—e.g. for migrations.

- [Usage](#usage)
- [Scripts](#scripts)
  - [`migrate-glintrc`](#migrate-glintrc)
  - [`auto-glint-nocheck`](#auto-glint-nocheck)

## Usage

Each script can be invoked either directly from the npm registry with `npx`:

```sh
npx -p @glint/scripts {script-name} {...script-args}
```

Or by installing `@glint/scripts` as a project-local dependency and then executing a script directly:

```sh
npm install -D @glint/scripts
npx {script-name} {...script-args}
# or
yarn add --dev @glint/scripts
yarn {script-name} {...script-args}
# or
pnpm i -D @glint/scripts
pnpm {script-name} {...script-args}
```

Or with a global installation, using either your package manager or [Volta](https://volta.sh):

```sh
volta install @glint/scripts
{script-name} {...script-args}
```

## Scripts

### `migrate-glintrc`

The `migrate-glintrc` script automates migrating from `.glintrc.yml` files to using a `glint` key within `tsconfig.json` files.

Usage:

```sh
npx -p @glint/scripts migrate-glintrc <path(s) to glintrc.yml files to migrate>
```

### `auto-glint-nocheck`

The `auto-glint-nocheck` script automatically adds a `{{! @glint-nocheck }}` comment at the top of any templates in the given files that currently have type errors.

It accepts one or more globs specifying what files it should inspect for type errors.

This script can be used when first adopting Glint in an existing project in order to immediately begin enforcing type safety for new templates while incrementally converting existing ones over time. Templates with a `@glint-nocheck` directive will still benefit from best-effort editor support for features such as hover information, go-to-definition, etc, though the quality of these features will improve the closer the template and its backing module are to being completely typesafe.

Sample usage:

```sh
npx -p @glint/scripts auto-glint-nocheck '{app,tests}/**/*.{ts,hbs,gts}'
```

The `nocheck` directive prepended to multiline templates will include a brief explanatory comment. By default, this looks like `{{! @glint-nocheck: not typesafe yet }}`, but the message can be customized with the `--explanation` flag.

**Note**: this script requires that `@glint/core` >= v0.9.6 be available locally in the project where you are running it.
npm package: @norith/glint-template
Description: Type definitions to back typechecking for Glimmer templates
Author: Dan Freeman
Latest version: 1.0.1

# `@glint/template`

This package contains type declarations used by other [glint] packages for perfoming TypeScript analysis of Glimmer templates. These types form the basis on which [glint-environment packages] are built.

[glint]: https://github.com/typed-ember/glint
[glint-environment packages]: https://www.npmjs.com/search?q=keywords:glint-environment
npm package: @norjs/cloud-client
Description: Client for NorJS's cloud framework
Author: Jaakko-Heikki Heusala
Latest version: 1.3.3

Client for NorJS's cloud framework
==================================

This module creates client interfaces into services provided by 
[`@norjs/cloud-backend`](https://www.npmjs.com/package/@norjs/cloud-backend).

Install: `npm i --save '@norjs/cloud-client'`

```javascript
import cloudClient from '@norjs/cloud-client';

cloudClient('http://localhost:3000').then(instance => {
	return instance.getDate().then(date => {
		return instance.echo('foobar').then(str => {
			console.log('.echo("foobar") returned "' + str + '" of type '+ typeof str+ " and of class "+ str.constructor.name);
		});
	});
});
```
npm package: @norjs/cloud-common
Description: Common files for NorJS's cloud framework
Author: Jaakko-Heikki Heusala
Latest version: 1.3.3

Common files for NorJS's cloud framework
========================================

Install: `npm install --save '@norjs/cloud-common`

### `createBodyIDs()` -- Create unique identifier based on object content 

This function creates unique IDs for cloud objects based on their content.

```
import { createBodyIDs } from '@norjs/cloud-common';

let body = {
  hello: "world"
};
let id, hash;
[id, hash] = createBodyIDs(body);

body.$id = id;
body.$hash = hash;
```
npm package: @norjs/database
Description: NorJS Database Service client
Author: Jaakko Heusala
Latest version: 1.0.14

# @norjs/database

JSDoc Configurable Database Service

### Design

This is a simple document database service implementing a REST interface to a data over a UNIX socket file.
 
The data can be defined using JSDoc-style configuration files and our
 [TypeUtils](https://github.com/norjs/utils#typeutils).

### Usage

-------------------------------------------------------------------------------------

First define your custom data objects in a file named `./types.js`:

```js

const TypeUtils = require('@norjs/utils/Type');

/**
 * @typedef {Object} MyResourceItemDTO
 * @property {number} id - My resource id
 * @property {string} name - My resource name
 */
TypeUtils.defineType(
    "MyResourceItemDTO", 
    {
        "id": "number",
        "name": "string"
    }
);

/**
 * @typedef {Object} MyResourceDTO
 * @property {number} id - My resource id
 * @property {string} name - My resource name
 * @property {boolean} deleted - Deleted or not?
 * @property {Array.<MyResourceItemDTO>} items - My items
 */
TypeUtils.defineType(
    "MyResourceDTO", 
    {
        "id": "number",
        "name": "string",
        "deleted": "boolean",
        "items": "Array.<MyResourceItemDTO>"
    }
);

```

#### Install

`npm install -g @norjs/database'

#### Start the service:

See [@norjs/database-service](https://github.com/norjs/database-service) about running a service.

#### Create a resource:

```
NODE_CONNECT=./socket.sock \
nor-database --create --set='{"id": 1, "name": "Foo"}'
```

#### Get a specific resource:

```
NODE_CONNECT=./socket.sock \
nor-database --get --where='{"id": 1}'
```

#### Get a list of resources:

```
NODE_CONNECT=./socket.sock \
nor-database --list
```

#### Get a list of resources by name:

```
NODE_CONNECT=./socket.sock \
nor-database --list --where='{"name": "Foo"}'
```

#### Update a resource:

```
NODE_CONNECT=./socket.sock \
nor-database --update --set='{"name": "Bar"}' --where='{"id": 1}'
```

#### Delete a resource:

```
NODE_CONNECT=./socket.sock \
nor-database --delete --where='{"id": 1}'
```
npm package: @norjs/database-service
Description: NorJS Database Service
Author: Jaakko Heusala
Latest version: 1.0.10

# @norjs/database-service

JSDoc-configurable database service over UNIX socket file

### Design

This is a simple document database service implementing a REST interface to a data over a UNIX socket file.
 
The data can be defined using JSDoc-style configuration files and our
 [TypeUtils](https://github.com/norjs/utils#typeutils).

### Usage

-------------------------------------------------------------------------------------

First define your custom data objects in a file named `./types.js`:

```js

const TypeUtils = require('@norjs/utils/Type');

/**
 * @typedef {Object} MyResourceItemDTO
 * @property {number} id - My resource id
 * @property {string} name - My resource name
 */
TypeUtils.defineType(
    "MyResourceItemDTO", 
    {
        "id": "number",
        "name": "string"
    }
);

/**
 * @typedef {Object} MyResourceDTO
 * @property {number} id - My resource id
 * @property {string} name - My resource name
 * @property {boolean} deleted - Deleted or not?
 * @property {Array.<MyResourceItemDTO>} items - My items
 */
TypeUtils.defineType(
    "MyResourceDTO", 
    {
        "id": "number",
        "name": "string",
        "deleted": "boolean",
        "items": "Array.<MyResourceItemDTO>"
    }
);

```

#### Start the service:

```
NOR_DATABASE_LOAD_TYPES='./types.js' \
NOR_DATABASE_RESOURCES=MyResourceDTO \
NOR_DATABASE_STORE='./my-resource-dir' \
NODE_LISTEN=./socket.sock \
npm start
```

#### Using the service

See [@norjs/database](https://github.com/norjs/database#create-a-resource) about using the service.
npm package: @norjs/debug
Description: Debug helpers for JavaScript
Author: Jaakko-Heikki Heusala
Latest version: 1.3.3

@norjs/debug
============

Debug helpers for JavaScript.

Installation
------------

You can install the module from the NPM: `npm install -d @norjs/debug`

Get current line number
-----------------------

You can use `debug.__line` to get current line number for debugging purposes.

Get current stack
-----------------

`debug.__stack` is used by `debug.__line` to get the current line number.

Development or production mode tests
------------------------------------

You can test for development and/or production mode (NODE_ENV) with the 
`debug.isProduction()` and `debug.isDevelopment()` which will return boolean 
values, `true` or `false`.

Start the app using `NODE_ENV=production node app.js` for production mode.

Start the app using `NODE_ENV=development node app.js` for development mode.

Default is development mode.

Write debug log messages
------------------------

You may use `debug.log(msg, [msg2...])` to write debug messages. This function 
will only write log if the app is running in the development mode. All 
non-string arguments will be converted to string.

Commercial Support
------------------

You can buy commercial support from [Sendanor](https://sendanor.com/).
npm package: @norjs/event
Description: NorJS Event observer and client support
Author: Jaakko Heusala
Latest version: 1.0.14

# NorJS Event Observer Library

This is a library which implements an interface to trigger and listen events from 
[The NorJS Event Service](https://github.com/norjs/event-service).

### Design

It is a NodeJS library which can connect to a local event service running on the system and through 
it possibly connect to multiple top level event servers and services running on other systems. 

Communication between the library and local service is implemented using long polling HTTP over 
local UNIX socket file.

### Install

`npm install @norjs/event`

### Usage

### Command line usage

Wait for an event:

```
if NODE_CONNECT=/path/to/socket.sock nor-event --wait=foo; then
  echo Event happened
else
  echo Timeout happened
fi
```

Trigger an event:

```
NODE_CONNECT=/path/to/socket.sock nor-event --trigger=foo --payload='{"hello":"world"}'
```
npm package: @norjs/event-service
Description: NorJS Event Service
Author: Jaakko Heusala
Latest version: 1.0.14

# NorJS Event Service

This is a local service which passes on events to 
[event servers](https://github.com/norjs/event-server) and 
[observers](https://github.com/norjs/event).

### Design

It is a NodeJS service which has one or more configured top level event servers. 

Local observers can connect to it over a UNIX socket file.

Event must be triggered on only one top level server, unless the server is unavailable.

Communication between the service and a top level server is implemented using either a long 
polling HTTP(S) connection (if the server cannot connect to the service directly) or direct 
two-way HTTP(S)/UNIX-Socket connection (if connection is possible both ways).

Communication between the service and observers is implemented over a UNIX socket file with 
HTTP long polling.

### Install

`npm install -g @norjs/event-service`

### Usage

#### Start a service on `./socket.sock`:

```
NODE_LISTEN=socket.sock \
nor-event-service
```

#### Wait for an event:

```
if NODE_CONNECT=/path/to/socket.sock nor-event --wait=foo; then
  echo Event happened
else
  echo Timeout happened
fi
```

#### Trigger an event:

```
NODE_CONNECT=/path/to/socket.sock nor-event --trigger=foo --payload='{"hello":"world"}'
```

#### Start a service on `./socket.sock` with configured types:

```
NOR_EVENT_LOAD_TYPES='./types.js' \
NOR_EVENT_PAYLOAD_TYPES='{"my-resource:created": "MyResourceDTO"}' \
NODE_LISTEN=./socket.sock \
nor-event-service
```

And define your types using JSDoc-style in a file named `./types.js`: 

```js
const TypeUtils = require('@norjs/utils/Type');

/**
 * @typedef {Object} MyResourceDTO
 * @property {number} id - My resource id
 * @property {string} name - My resource name
 * @property {boolean} deleted - Deleted or not?
 * @property {Array.<MyResourceItemDTO>} items - My items
 */
TypeUtils.defineType(
    "MyResourceDTO", 
    {
        "id": "number",
        "name": "string",
        "deleted": "boolean",
        "items": "Array.<MyResourceItemDTO>"
    }
);

```

You can use this file from your own application. It also integrates to WebStorm's 
quick documentation, too, since it is standard JavaScript and JSDoc.
npm package: @norjs/function
Description: Function utilities for JavaScript
Author: Jaakko-Heikki Heusala
Latest version: 1.3.2

@norjs/function
===============

Function utilities for JavaScript.

Usage
-----

Install from NPM: `npm install -d @norjs/function`

### .curry() -- Faster bind() implementation without `this`

```javascript
var FUNCTION = require("@norjs/function");

function sum(a, b) {
	return a + b;
}

var sum_10 = FUNCTION(sum).curry(10);

30 === sum(10, 20);
30 === sum_10(20);
```

### .bind() -- Faster bind() implementation with support for `this`

```javascript
var FUNCTION = require("@norjs/function");

var obj = {
	'base': 100,
	'sum': function(a, b) {
		return this.base + a + b;
	}
};

var sum_10 = FUNCTION(obj.sum).bind(obj, 10);

130 === obj.sum(10, 20);
130 === sum_10(20);
```

See [our benchmarks](https://github.com/sendanor/jslabs): 

```
mapping-with-bind x 142,370 ops/sec ±2.04% (83 runs sampled)
mapping-with-custom-bind-2-ifelse x 617,267 ops/sec ±2.88% (77 runs sampled)
mapping-with-custom-bind-2 x 588,005 ops/sec ±2.91% (78 runs sampled)
mapping-with-custom-bind-3 x 635,116 ops/sec ±2.10% (82 runs sampled)
mapping-with-custom-bind-predefined x 608,043 ops/sec ±2.47% (78 runs sampled)
mapping-with-custom-bind x 509,248 ops/sec ±2.75% (84 runs sampled)
mapping-with-function x 592,160 ops/sec ±2.81% (80 runs sampled)
mapping-with-inline-functions x 486,078 ops/sec ±5.05% (82 runs sampled)
mapping-with-nor-function x 590,456 ops/sec ±2.03% (82 runs sampled)
mapping-with-predefined-bind x 198,182 ops/sec ±3.46% (86 runs sampled)
mapping-with-predefined-function x 635,431 ops/sec ±5.07% (76 runs sampled)
Fastest is mapping-with-custom-bind-3,mapping-with-predefined-function,mapping-with-custom-bind-2-ifelse
```

### Serialize function to String

```javascript
var FUNCTION = require("@norjs/function");
function foo(a, b) { return a + b; }
var str = FUNCTION(foo).stringify();
str === "function foo(a, b) { return a + b; }";
```

### Unserialize string to function

```javascript
var FUNCTION = require("@norjs/function");
var str = "function foo(a, b) { return a + b; }";
var fun = FUNCTION.parse(str);
fun(10, 20) === 30;
```

License
-------

[MIT-style](LICENSE)

Commercial Support
------------------

You can buy commercial support from [Sendanor](http://sendanor.com/).
npm package: @norjs/is
Description: Simple JavaScript test functions
Author: Jaakko-Heikki Heusala
Latest version: 1.3.3

[![Build Status](https://secure.travis-ci.org/sendanor/nor-is.png?branch=master)](http://travis-ci.org/sendanor/nor-is)

nor-is
======

Simple test functions for Node.js

TODO
----

We use [Trello board](//trello.com/b/69wxOoiJ/nor-is) to organize development and keep track on things to do.


Commercial Support
------------------

You can buy commercial support from [Sendanor](http://sendanor.com/software).
npm package: @norjs/pgrunner
Description: NorJS PostgreSQL Database Server Runner for development purposes
Author: Sendanor
Latest version: 2.0.2

@norjs/pgrunner (Originally [sendanor/nor-pgrunner](https://github.com/sendanor/nor-pgrunner))
=========================================

Utility which can be used to start PostgreSQL server instances temporarely. Good for testing.

### Installation

Install from NPM: `npm install -g @norjs/pgrunner`

### Usage over CLI

Use with CLI:

```
norjs-pgrunner create
norjs-pgrunner list
norjs-pgrunner destroy
```

### Usage over Node.js

Use with Node.js:

```
var pgrunner = require('@norjs/pgrunner');
```

Example usage:

```
pgrunner({
	'host': '127.0.0.1',  // Defaults to '127.0.0.1'
	'port': 55432,        // Defaults to '55432'
	'user': 'foo',        // Defaults to USER from ENV
	'database': 'dbname'  // Defaults to same value as the user option
}).then(function(server) {
	
	// server.pgconfig is a string like 'pg://jhh@127.0.0.1:55432/jhh'
	// server.settings has the same options as properties: host, port, user, database
	// server.env has the environment variables the server is using
	
	// Stop the instance
	return server.stop().then(function() {
		console.log('Stopped successfully');
	});

}).fail(function(err) {
	console.log('Error: ' + err);
}).done();
```

Commercial Support
------------------

You can buy commercial support from [Sendanor](http://sendanor.com/).
npm package: @norjs/portal-service
Description: NorJS Portal Service for other microservices
Author: Jaakko Heusala
Latest version: 1.0.17

# @norjs/portal-service

This is a micro service acting as a HTTP gateway between services.

See also [@norjs/manager-service](https://github.com/norjs/manager-service) which can use the same configuration file and manages service start & stop.

The main use case is to act as an authorizing gateway between TCP/IP network and local file-based socket services.

### Configuration File

A configuration file `./nor.json` could look like:

```json
{
  "auth": {
    "default": {
      "path": "./MyAuthenticator.js",
      "config": "./auth.json"
    }
  },
  "routes": {
    "/event": {
      "socket": "./event.sock",
      "auth": "default"
    },
    "/database": {
      "socket": "./database.sock",
      "auth": "default"
    },
    "/public": {
      "target": "http://public.example.com/"
    }
  }
}
```

### Authentication

Implement an authenticator in a file named `./MyAuthenticator.js`:

```js
/**
 * @implements {NorPortalAuthenticator}
 */
class MyAuthenticator {
    
    constructor (config) {
        this._config = config;
    }
    
    /**
     * 
     * @param context {NorPortalContextObject}
     * @returns {boolean}
     */
    hasAccess (context) {
        return !!context && (context.password === this._config.password);
    }
    
}

module.exports = MyAuthenticator;
```

***Note!*** This is just a simplified example.

### Start the service

Start in a TCP port `localhost:3000`:

```
NODE_LISTEN='3000' nor-portal-service
```

Start in a socket file:

```
NODE_LISTEN='./portal.sock' nor-portal-service
```

The configuration will be readed from `./nor.json` by default. You may change it:

```
NOR_PORTAL_CONFIG='./portal/nor.json' \
NODE_LISTEN='./portal.sock' \
nor-portal-service
```
npm package: @norjs/socket-service
Description: Support files for implementing micro services over UNIX socket
Author: Jaakko Heusala
Latest version: 1.0.14

# @norjs/socket-service

Support files for implementing UNIX socket file based micro services.

See [@norjs/event-service](https://github.com/norjs/event-service) and [@norjs/database-service](https://github.com/norjs/database-service) for examples.
npm package: @norjs/ui
Description: Common NorJS frontend components
Author: Jaakko Heusala
Latest version: 1.0.18

# `@norjs/ui`

Common NorJS frontend components.

### WebStorm and Typing in JSDoc

@FIXME: This should be an article at norjs.com

#### Enable ES6 in WebStorm

Change to use *EcmaScript 6* at *Webstorm* -> *Preferences* -> *Languages & Frameworks* -> *JavaScript*.

#### Install 3rd Party typing information

You may 3rd party libraries from *Webstorm* -> *Preferences* -> *Languages & Frameworks* -> *JavaScript* -> *Libraries*.

You should have *Node.js Core* and *HTML* enabled.

We use type names from [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) for AngularJS, UI Router, 
etc. You should clone this repository on your local system.

You can install these .d-files to your WebStorm so it can also understand them. 

We recommend to install only specific versions:

  * types/angular/index.d.ts
  * types/angular-ui-router/index.d.ts
  * types/angular-translate/index.d.ts
  * types/angular-sanitize/index.d.ts
  * types/angular/jqlite.d.ts
  * types/lodash/index.d.ts
  * types/moment-timezone/index.d.ts
  * types/uuidv4/index.d.ts

You may install these libraries from *Webstorm* -> *Preferences* -> *Languages & Frameworks* -> *JavaScript* -> *Libraries*.

#### Typing Quick List

| Injectable Name               | Type Name                       |
| ----------------------------- | ------------------------------- |
| `$injector`                   | `angular.auto.IInjectorService` |
| `$element`                    | `JQLite`                        |
| `$q`                          | `angular.IQService`             |
| `$attrs`                      | `angular.IAttributes`           |
| `$scope`                      | `angular.IScope`                |
| `$compile`                    | `angular.ICompileService`       |
| `$timeout`                    | `angular.ITimeoutService`       |
| `$document`                   | `angular.IDocumentService`      |
| `$rootScope`                  | `angular.IRootScopeService`     |
| `$interval`                   | `angular.IIntervalService`      |
| `$http`                       | `angular.IHttpService`          |
| `$state`                      | `angular.ui.IState`             |
| AngularJS's component options | `angular.IComponentOptions`     |
| form's controller             | `angular.IFormController`       |
| ng-model's controller         | `angular.INgModelController`    |
npm package: @norjs/web-client
Description: The NorJS Web Runtime Environment
Author: Jaakko-Heikki Heusala
Latest version: 1.0.17

# The NorJS Runtime Environment.

This is a MIT-licensed runtime environment for apps created with our 
not-yet-published commercial *NorJS Development Environment*, **however** *it 
will run any compatible AngularJS ES6 app as well*.

*The NorJS RE* is still under active development and there is no official 
stable release until we release it to the first commercial customer. 

You may follow the progress in [the feature issue #1](https://github.com/norjs/norjs/issues/1).

### Install norjs command line interface

```
npm install -g @norjs/web-client
```

### Install NorJS Runtime Environment

```
norjs install
```

### Run NorJS app in a development mode

```
norjs run ./app.json
```

### Build static files for production deployment

```
norjs build ./app.json
``` 

### Hello World app

You can extend your app logic with external ES6 enabled AngularJS modules.

Your custom module `./myapp.js`:

```js
import angular from "angular";

let waMainViewComponent = {
  template: `
<main>
  <h3>Main page</h3>

  <p>Hello World</p>
</main>
`,
  controller: class WaMainViewController {
  }
};

export default angular.module(
  "myapp"
  , [])
  .component('myMainView', waMainViewComponent)
  .name;
```

Configuration file `./app.json`:

```json
{
  "name": "Hello World",
  "modules": [
    "myapp"
  ],
  "states": {
    "main": {
      "name": "main"
    , "options": {
        "url": "/main"
      , "component": "myMainView"
      }
    }
  }
}
```

Then file `./norjs.json` (or specify `--import=myapp.js --config=./app.json`):

```json
{
  "import": "./myapp.js",
  "config": "./app.json"
}
```

Then run it:

```
norjs run
```

Or build it:

```
norjs build
```