open-index/open-npm huggingface dataset:
npm package: @singletn/indexeddb
Description: ## Persist your data
Author: Nic Reichert
Latest version: 0.0.19

# @singletn/indexeddb  &#8194;[![npm version](https://img.shields.io/npm/v/@singletn/indexeddb.svg?style=flat)](https://www.npmjs.com/package/@singletn/indexeddb)

## Persist your data

If you'd like to have a persistent state in `indexeddb`, you can do so by having your state extend `IndexedDBSingletn`.

The implementation is the same as using the `SingletnState` from [@singletn/core](../singletn-core).

```js
import { IndexedDBSingletn } from '@singletn/indexeddb'

interface UserState {
  name: string
  email: string
  phoneNumber: string
}

export class User extends IndexedDBSingletn<UserState> {
  state = {
    name: '',
    email: '',
    phoneNumber: '',
  }

  public setUser = (user: UserState) => this.setState(user)

  public setName = (name) => this.setState({ name })

  public setEmail = (email) => this.setState({ email })

  // ...
}
```

## Cleanup remark

Anytime that you use `clearSingletns` from [@singletn/core](../singletn-core), the databases created will be all cleared, and the data will, obviously, no longer persist.

If, however, you'd like to manually trigger a deletion of the database for any given singletn, you can call the `clearDB` method:

```js
export class User extends IndexedDBSingletn<UserState> {
  // ...

  public cleanup = () => this.clearDB()

  // ...
}
```

## Other ways to store your state

`singletn` also allows you to use different base states to store your data in other ways. Read more about it in the subprojects:

- [@singletn/core](../singletn-core)
- [@singletn/local-storage](../local-storage)
npm package: @singletn/local-storage
Description: ## Persist your data
Author: Nic Reichert
Latest version: 0.0.19

# @singletn/local-storage  &#8194;[![npm version](https://img.shields.io/npm/v/@singletn/local-storage.svg?style=flat)](https://www.npmjs.com/package/@singletn/local-storage)

## Persist your data

If you'd like to have a persistent state in your `localStorage`, you can do so by having your state extend `LocalStorageSingletn`.

When extending `LocalStorageSingletn`, there's a small requirement you need to follow: you need to have a `constructor` method in your state, that calls `super()` with the initial state. Here's how your state would look like with `LocalStorageSingletn`:

```js
import { LocalStorageSingletn } from '@singletn/local-storage'

interface UserState {
  name: string
  email: string
  phoneNumber: string
}

export class User extends LocalStorageSingletn<UserState> {
  constructor() {
    // First parameter is used to prefix all the keys for this singletn.
    // Make sure this key is unique to avoid having broken data.
    super('userData', {
      name: '',
      email: '',
      phoneNumber: '',
    })
  }

  public setUser = (user: UserState) => this.setState(user)

  public setName = (name) => this.setState({ name })

  public setEmail = (email) => this.setState({ email })

  // ...
}
```

The `constructor` is necessary so that the initial state can use the stored data keys and have the default values as fallbacks. The constructor params are:

| Name          | Description |
| ------------- | ----------- |
| `singletnKey` | Unique key to be used to prefix all keys on local storage that refers to this singletn |
| `initialState`  | A state to be used as a fallback for when the local storage does not contain any definition for the keys expected from the state |
npm package: @singleware/class
Description: Singleware class visibility package.
Author: Silas B. Domingos
Latest version: 1.1.19

# Class

This package provides some decorators to ensure the class member visibility at runtime.

## How it works

When the JS run all decorators defined for your class will wrap the original methods to check its access rules, before pass the control back to the original method if the called method is private or protected, the wrapper goes check the context to determine if the current call is granted or not.

## Usage

```ts
import * as Class from '@singleware/class';

@Class.Describe()
class Example extends Class.Null {
  @Class.Private()
  private privateProperty = '';

  @Class.Protected()
  @Class.Property()
  protected protectedProperty = '';

  @Class.Public()
  @Class.Property()
  public publicProperty = '';

  @Class.Private()
  private privateMethod(): void {}

  @Class.Protected()
  protected protectedMethod(): void {}

  @Class.Public()
  public publicMethod(): void {}
}
```

### Decorators

| Name      | Description                                                                          |
| --------- | ------------------------------------------------------------------------------------ |
| Describe  | Wraps the decorated class to ensure its rules at runtime.                            |
| Private   | Makes the decorated member as private, visible only by its class.                    |
| Protected | Makes the decorated member as protected, visible on by its class and derived classes |
| Public    | Makes the decorated member as public, visible by every class.                        |
| Property  | Makes the decorates member as enumerable to use with loop statements like for...     |

### Methods

| Name    | Description                                                        |
| ------- | ------------------------------------------------------------------ |
| perform | Performs the specified callback using the specified context rules. |
| resolve | Resolves the given wrapped context to the original context.        |

## Install

Using npm:

```sh
npm i @singleware/class
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleware/jsx
Description: Singleware JSX package.
Author: Silas B. Domingos
Latest version: 1.0.32

# JSX

This package provides some classes to help you create JSX statements in a easy way.

## Configuration

Add the specified lines below into your tsconfig.json

```json
{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "JSX.create"
  }
}
```

## Usage

```tsx
import * as JSX from '@singleware/jsx';

const block = (
  <div>
    <span>Some test with a</span>
    <a href="/test">test link.</a>
  </div>
);
```

> You can use with node.js or browser.

## Install

Using npm:

```sh
npm i @singleware/jsx
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleware/oss
Description: Singleware object style sheets.
Author: Silas B. Domingos
Latest version: 1.0.3

# Object Style Sheets

This package provides some classes to help you create CSS statements at runtime in a easy way.

## Usage

```ts
import * as OSS from '@singleware/oss';

const stylesheet = new OSS.Stylesheet();
const style = stylesheet.select('.my-class');

style.display = 'block';
style.padding = '1rem';
style.boxSizing = 'border-box';

const css = stylesheet.toString();
```

## Install

Using npm:

```sh
npm i @singleware/oss
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleware/ui-autocomplete
Description: Singleware UI autocomplete package.
Author: Silas B. Domingos
Latest version: 1.0.18

# UI-Autocomplete

## Install

Using npm:

```sh
npm i @singleware/ui-autocomplete
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleware/ui-menu
Description: Singleware UI menu package.
Author: Silas B. Domingos
Latest version: 1.0.4

# UI-Menu

Custom HTML element used to wrap most essential actions for a menu component.

### Properties

| Name        | Description                                              |
| ----------- | -------------------------------------------------------- |
| value       | Get and set the current selected option by its value     |
| disabled    | Get and set the disabled state                           |
| selectable  | Get and set the selectable state                         |
| orientation | Get and set the element orientation. Use `column`, `row` |

### Methods

| Name         | Description                      |
| ------------ | -------------------------------- |
| addGroup     | Add a group into the menu        |
| addOption    | Add an option into the menu      |
| removeOption | Remove options from the menu     |
| clearOptions | Remove all options from the menu |

## Install

Using npm:

```sh
npm i @singleware/ui-menu
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleware/ui-radiobox
Description: Singleware UI radiobox package.
Author: Silas B. Domingos
Latest version: 1.0.26

# UI-Radiobox

## Install

Using npm:

```sh
npm i @singleware/ui-radiobox
```

## License

[MIT &copy; Silas B. Domingos](https://balmante.eti.br)
npm package: @singleway/avatars-generator
Description: This is a port from  Sketch library [Avataaars](https://avataaars.com/) designed by [Pablo Stanley](https://twitter.com/pablostanley).
Author: Tony Wang
Latest version: 0.0.8

# Vue component for Avatars
This is a port from  Sketch library [Avataaars](https://avataaars.com/) designed by [Pablo Stanley](https://twitter.com/pablostanley). 

## Features
 - SVG based
 - Light weight
 - Scalable
 - Easy to use
 - Easy to integrate with custom editor
 - Comes from [Avataaars](https://avataaars.com/)

#### How it works

Import the Avataaars component. Pass it an object called "avatarOptions" with some parameters. Let the magic happen.

## Installation
```
npm install @singleway/avatars-generator --save
```

## Usage

- Using the Avataaars component with an avatarOptions input :
```html
  <template>
    <Avataaars 
    // You can set any size as it does not exceed the maxWidth and maxHeight properties (264px by 280px)
    :width=200
    :height=200
    // Your avatar options
    :avatarOptions="{
      backgroundType: selectedBackgroundType,
      backgroundColor: selectedBackgroundColor,
      skinColor: selectedSkinColor,
      clothesType: selectedClothesType,
      clothesColor: selectedClothesColor,
      clothesGraphicsType: selectedClothesGraphicType,
      eyesType: selectedEyesType,
      eyebrowType: selectedEyebrowType,
      mouthType: selectedMouthType,
      facialHairType: selectedFacialHairType,
      facialHairColor: selectedFacialHairColor,
      accessoriesType: selectedAccessoriesType,
      topType: selectedTopType,
      topColor: selectedTopColor,
    }" />
  </template>

  <script>
  import Avataaars from 'vue-avataaars'

  export default {
    name: 'Your component',
    components: {
      Avataaars,
    },
  </script>
```

- Using the Avataaars for random avatar generation :
```html
  <template>
    // No props, no problems
    <Avataaars />
  </template>
  
  <script>
  import Avataaars from 'vue-avataaars'

  export default {
    name: 'Your component',
    components: {
      Avataaars,
    },
  </script>
```

## Props for the Avataaars component
```html
    iconName: {
      type: String,
      default: 'avatar',
      required: false,
    },
    width: {
      type: Number,
      default: 264,
      required: false,
    },
    height: {
      type: Number,
      default: 280,
      required: false,
    },
    avatarOptions: {
      type: Object, required: false
    },
```

## Props of avatarOptions
A complete list of every options can be found here in the "./scr/avataaarsOptions.json"
npm package: @singmyr/react-scripts
Description: Custom configuration and scripts for Create React App.
Latest version: 1.1.4

# react-scripts

This package includes scripts and configuration used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
Please refer to its documentation:

* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
* [User Guide](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md) – How to develop apps bootstrapped with Create React App.
npm package: @singpath/event-monitor
Description: Monitor the user events
Latest version: 0.1.0

# Event monitor

[![Build Status](https://travis-ci.org/singpath/event-monitor.svg?branch=master)](https://travis-ci.org/singpath/event-monitor)

Monitors event participant solution and updates their progress


## Requirements

- nodejs 4+ (you can use nvm to install and switch between nodejs versions).
- npm version 3.

on OS X:
```shell
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.2/install.sh | bash
exec -l $SHELL
nvm install 4
npm install npm -g
```

If you run `nvm use 4`, you would now see something like that:
```
$ nvm use 4
Now using node v4.x.x (npm v3.x.x)
```

## Setup

```shell
git clone https://github.com/singpath/event-monitor.git
cd event-monitor
nvm install
```

## Running monitor

To monitor the event owned by "bob", would run (replacing xxxx by the firebase
auth secret):
```shell
./bin/singpath-event-monitor
    --firebase-id singpath \
    --firebase-secret xxxxx
    --event-public-id EVENT_OWNER_PUBLIC_ID
```

## Usage

```
$ ./bin/singpath-event-monitor --help
usage: singpath-event-monitor [-h] [-v] [-d] [--debug-firebase] [-s] [-i ID]
                              [-a SECRET] [-p ID] [--list-only]


Monitor event participants solution to update their progress

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -d, --debug           print debug messages
  --debug-firebase      print firebase rules debug messages
  -s, --silent          print only error messages
  -i ID, --firebase-id ID
                        ID of of the firebase DB to watch
                        (default: singpath)
  -a SECRET, --firebase-secret SECRET
                        Firebase auth secret
                        (default: null)
  -p ID, --event-public-id ID
                        Owner of the events to watch
                        (default: null)
  --list-only           print only events that would be watched.

Environment variables:
  SINGPATH_FIREBASE_ID        ID of of the firebase DB to watch.
  SINGPATH_FIREBASE_SECRET    Firebase auth secret.
  SINGPATH_EVENT_PUBLIC_ID    Owner's Public id of the events to watch.

Config:
  You can set the default values with a JSON file named './.singpatheventmonitorrc' in your
  working directory.

  Example:

    {
      "firebaseId": "my-db",
      "firebaseSecret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "eventPublicId": "bob"
    }
```

## TODO

1. Add more logging messages;
2. update all participant progress and ranking every hours (in case some student
   forget to report new badges);
3. add a docker image.
npm package: @singpath/rules
Description: Firebase Rules for Singpath.com DB
Latest version: 1.1.1

# firebase-rules

[![Build Status](https://travis-ci.org/singpath/singpath-rules.svg)](https://travis-ci.org/singpath/singpath-rules)
[![Coverage Status](https://coveralls.io/repos/singpath/singpath-rules/badge.svg?branch=master&service=github)](https://coveralls.io/github/singpath/singpath-rules?branch=master)

Rules and migration scripts for Singpath Firbase db.

## Requirements

- node 4+; you can use something like [nvm](https://github.com/creationix/nvm)
  to install multiple node version.
- one or more [Firebase](https://firebase.com) project. If it will be used
  in production, you should have at production and a staging db


## Setup

We will rely [firebase-tools](https://github.com/firebase/firebase-tools) to
upload data.

1. setup a new npm project and install dependencies:

        ```shell
        npm install -g firebase-tools
        npm install -g @singpath/singpath-rules
        ```

2. setup a Firebase project in the current directory (it should like
   to your staging DB):

        ```shell
        npm init
        firebase init
        firebase login
        ```

3. edit firebase.json to add the "rules" entry:

        ```json
        {
          "firebase": "singpath-dev",
          "rules": "rules.json",
          "public": "public",
          "ignore": [
            "firebase.json",
            "**/.*",
            "**/node_modules/**"
          ]
        }
        ```

4. upload rules and seed data to your Firebase DB.

        ```
        singpath-rules init-db
        ```


## Building json rules

`firebase-tools` (see below) will support bolt rules directly sometime in the
future, but for now we need them in the current json encoded form.

To compile the rules:
```shell
singpath-rules compile
```

You will find the rules in `rules.json`.


## Uploading rules

```json
./node_modules/.bin/singpath-rules upload-rules
```

Use the `-f` to switch the Firebase DB to upload to and `-a` to set the secret.


## Development

See [CONTRIBUTING.md](./CONTRIBUTING.md).
npm package: @singpath/tools
Description: Singpath package script helpers
Author: Chris Boesch
Latest version: 0.0.8

# Singpath's tools

Singpath package script helpers.

## Install

```shell
npm install --save-dev @singpath/tools
```


## Usage

### `exec`

```js
const tools = require('@singpath/tools');

// Execute shell command synchronously.
tools.exec('ls -la dist', {
  // by default it will print the command to the stdout
  printCmd: true,

  // by default, the command will inherit the node script stdout;
  // set this property to `true` to ignore the command stdout
  ignoreStdout: false,

  // same for the command stderr
  ignoreStderr: false
});
```

For more complex usage like piping, try [shelljs's](http://documentup.com/shelljs/shelljs)
`exec`.


### `clean`

```js

const tools = require('@singpath/tools');

tools.clean(['dist', 'coverage'], {
  // force removing the folders when this is set to `true`
  force: false,

  // info message prefix
  message: 'Removing build/test artifacts'
});
```


## `mocha`

```js
const tools = require('@singpath/tools');

tools.mocha(my-app/my-app.specs.js, {
  // Mocha ui
  ui: 'bdd'
});
```


## `instanbul`

```js
const tools = require('@singpath/tools');

tools.instanbul(my-app/my-app.specs.js, {
  // Mocha ui
  ui: 'bdd',

  // path to coverage directory (the directory must exist)
  coverage: path.resolve('./coverage'),

  // instanbul report types
  reports: ['lcov', 'text'],

  // exclude function factory
  exclude: function(baseURL) {
    return function excludeModule(path) {
      return path.startsWith(baseURL + 'jspm_packages') || path.endsWith('specs.js');
    }
  }
});
```

## `zip`

```js
const tools = require('@singpath/tools');

tools.zip('dist/my-app', 'dist/my-app.zip', {
  // where to save the directory in the archive; uses the directory name
  // by default.
  root: 'my-app'
}).then(
  () => console.log('archive created')
);
```
npm package: @singtone/nodemailer-sendgrid-transport
Description: A nodemailer transport plugin sending email via SendGrid's V3 REST API; Support SendGrid options such as categories, tracking settings or send_at etc; Support http, https, socks4 or socks5 proxy.
Author: John Xu
Latest version: 0.1.5

# nodemailer-sendgrid-transport

This repository is a nodemailer transport plugin sending email via SendGrid's V3 REST API.  
Support SendGrid options such as categories, tracking settings or send_at etc.  
Support http, https, socks4 or socks5 proxy via proxy-agent.

## dependencies
axios

## Usage

Install via npm.  

Support SendGrid options of *categories, send_at, batch_id, asm, ip_pool_name, mail_settings, tracking_settings*

```javascript
var nodemailer = require('nodemailer');
var sgTransport = require('@singtone/nodemailer-sendgrid-transport');
var proxy = require('proxy-agent');  //optional

var options = {
	auth: {
		api_key: 'SENDGRID_APIKEY'
	},
    proxyAgent: proxy(process.env.PROXY)  //optional. i.e. https://myproxy.sample.com:8080
}

var mailer = nodemailer.createTransport(sgTransport(options));
```

```javascript
var email = {
	to: ['john@foo.com', 'smith@bar.com'],
	from: 'david@baz.com',
	subject: 'Hello World',
	text: 'Awesome sauce',
	html: '<b>Awesome sauce</b>',
	attachments: {
		filename: 'text1.txt',
		content: 'aGVsbG8gd29ybGQh',
		encoding: 'base64'
	},
	sendGrid: {  //optional SendGrid Options
		"categories": [
			"cake",
			"pie",
			"baking"
		],
		"send_at": 1617260400,
		"tracking_settings": {
			"click_tracking": {
				"enable": true,
				"enable_text": false
			}
		}
	}
};

mailer.sendMail(email, function(err, res) {
	if (err) { 
		console.log(err) 
	}
	console.log(res);
});
```
npm package: @singular/cli
Description: Singular framework command line interface for project management
Author: Ramtin Soltani
Latest version: 1.0.0-beta.2

# Singular CLI

This package contains the command line interface (CLI) for [Singular framework](https://singularframework.com).

```bash
npm install @singular/cli -g
sg --version
sg --help
```

## Usage

The following commands serves as the CLI documentation:

```bash
sg --help
# sg <command> --help (for command-specific usage)
```

## Tests

```bash
npm test
```

## Building the Source

```bash
npm start
```

## Upgrading

Major versions of all `@singular` modules are all aligned with the framework's major. However, the minor and patch versions are independent of one another.

To safely upgrade from one major version to another, use `sg upgrade`.

To help with upgrading (using `sg upgrade`), there may be an incremental patch available with every major upgrade if necessary. The patch packages follow the name syntax `@singular/inc-patch-{{baseMajor}}-{{targetMajor}}` (e.g. `@singular/inc-patch-1-2`).
npm package: @singular/common
Description: Singular framework common module
Author: Ramtin Soltani
Latest version: 1.0.0-beta.2

# Singular Common

This package contains common elements for Singular framework, installed from `@singular/common`.

# Setup

  1. Clone this repo
  2. Run `npm install` to install all dependencies

# NPM Scripts

  - Build from source: `npm start`
  - Build documentation: `npm run docs`
  - Run tests: `npm test`
npm package: @singular/core
Description: Singular framework core module
Author: Ramtin Soltani
Latest version: 1.0.0-beta.7

# Singular Core

This package contains the core module for Singular framework, installed from `npm install @singular/core`.

# NPM Scripts

  - Build from source: `npm start`
  - Build documentation: `npm run docs`
  - Run tests: `npm test`
npm package: @singulargarden/gmail-filter-query-parser
Description: A nearley based parser to parse/serialise Gmail filter query.
Latest version: 0.0.8

# Gmail Filter Query Parser

Forked from [github.com/zorji/gmail-filter-query-parser](https://github.com/zorji/gmail-filter-query-parser)

A nearley based parser to parse/serialise Gmail filter query.

## Installation

```bash
npm install gmail-filter-query-parser
```

## Usage

```javascript
import { parse, serialise, HasAttachment, Subject } from 'gmail-filter-query-parser'

const parsed = parse('subject:(invoice) AND has:attachment')
console.log(parsed)
// {
//   "$and": [
//     {
//       "type": "subject",
//       "value": "invoice"
//     },
//     {
//       "type": "has:attachment"
//     }
//   ]
// }

const serialised = serialise(AND(
  Subject('invoice'),
  HasAttachment(),
))
console.log(serialised)
// 'subject:(invoice) AND has:attachment'
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)