open-index/open-npm huggingface dataset:
npm package: @johnlijie/ts_component
Description: React components library
Author: JOHN lijie
Latest version: 0.1.1

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
npm package: @johnlindquist/gatsby-remark-embed-codesandbox
Description: Embed a Codesandbox Editor in your Markdown
Author: John Lindquist
Latest version: 0.0.3

# @johnlindquist/gatsby-remark-embed-codesandbox

Embed a Codesandbox Editor in your Markdown

## Install

1. Install plugin to your site:

```bash
npm i @johnlindquist/gatsby-remark-embed-codesanbox
```

2. Add following to your `gatsby-config.js`:

```js
    plugins: [
      {
        resolve: "gatsby-transformer-remark",
        options: {
          plugins: [
          {
            resolve: "@johnlindquist/gatsby-remark-embed-codesandbox",
          }
          ]
        }
      },
```

3. Restart gastby.

## Usage

The following will now be converted to a proper iframe:

```markdown
[https://codesandbox.io/embed/o52jlrvjwy?view=editor](https://codesandbox.io/embed/o52jlrvjwy?view=editor)
```

## License

MIT
npm package: @johnlindquist/kit-enigo-win32-arm64-msvc
Description: Template project for writing node package with napi-rs
Latest version: 1.1.0

# `@johnlindquist/kit-enigo-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@johnlindquist/kit-enigo`
npm package: @johnlindquist/kit-enigo-win32-x64-msvc
Description: Template project for writing node package with napi-rs
Latest version: 1.1.0

# `@johnlindquist/kit-enigo-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@johnlindquist/kit-enigo`
npm package: @johnlindquist/mac-windows
Description: Provide information about Application Windows running and activate and Application.
Author: George Karagkiaouris
Latest version: 1.0.2

# mac-windows

> Provide information about Application Windows running and activate and Application.

**Important:** This package does not work on Windows or Linux

Requires macOS 10.12 or later. macOS 10.13 or earlier needs to download the [Swift runtime support libraries](https://support.apple.com/kb/DL1998).

## Instalation

To install mac-windows in your project add it using NPM
```javascript
npm install --save mac-windows
```

After that you can import the various functions as follows:
```js
import { getWindows, activateWindow } from 'mac-windows';
```

or

```js
const getWindows = require('mac-windows').getWindows
```

## Usage

### `getWindows(opts: Object): Array`

Returns a Promise with an array containing an object for each Application currently in the screen. Information included for each Application:
- **pid:** Process Id of the Application
- **ownerName:** Name of the Application (e.g. Google Chrome)
- **name:** Title of the main window of the application (e.g. Github)
- **width:** Current width of the main window
- **height:** Current height of the main window
- **x:** Horizontal position of the main window
- **y:** Vertical position of the main window
- **number:** The number of the window

```js
import { getWindows } from 'mac-windows';

getWindows().then(windows => {
  console.log(windows);
});

/*
[
  {
    pid: 320,
    ownerName: 'Finder',
    name: 'Desktop',
    width: 770,
    height: 436,
    x: 295,
    y: 100,
    number: 1027
  }, {
    pid: 11734,
    ownerName: 'Google Chrome',
    name: 'karaggeorge/mac-windows',
    width: 1276,
    height: 778,
    x: 0,
    y: 23,
    number: 63226
  }
]
*/
```

Extra options that can be passed in to `getWindows`:

| Name | Description | Type | Default Value |
|---|---|---|---|
| showAllWindows | Return all the windows for each Application instead of just the main one | `bool` | `false` |
| onScreenOnly | Return the windows from all the Applications even if they are not in the current screen | `bool` | `true` |

_NOTE:_ Swift and the AppKit Package don't support activating a specific window at the moment. When activating an Application the main window will be brought to the front. That is the last window that was used.

### `activateWindow(windowName: String)`

Activate the Application whose `ownerName` matches the given `windowName`.

Activating an Application will cause the Application's main window to come to the front of the screen.

```js
import { activateWindow } from 'mac-windows';

activateWindow('Finder');
```

## Contributing

Please feel free to submit a Pull Request, report a Bug or propose a Feature!

Thanks to the projects this was inspired by: [Active Window](https://github.com/wk-j/mac-active-window)

This package was created for [Kap](https://github.com/wulkano/kap)

## License
MIT Licensed. Copyright (c) George Karagkiaouris 2017.
npm package: @johnlindquist/twi
Description: A CLI tool to scrape tweets from a specific user using puppeteer.
Author: John Lindquist
Latest version: 1.4.1

# TweetIngest CLI

A CLI tool to scrape and gather tweets from a Twitter (X) user's timeline (without the official API).

## Installation

```bash
pnpm install -g @johnlindquist/twi
```

## Usage

```bash
twi [options] <username>
```

### Examples

```bash
# Scrape 50 tweets from Elon
twi johnlindquist

# Scrape up to 150 tweets, no editor
twi johnlindquist --max-tweets 150 --no-editor

# Print everything to console (still saves file)
twi johnlindquist --pipe
```

### Options

- `--max-tweets, -m`: Maximum number of tweets to scrape (default 50).
- `--debug`: Log verbose debug information.
- `--pipe, -p`: Print final output to stdout.
- `--no-editor, -n`: Save results but do not open in default editor.
- `--clipboard, -y`: Copy output to the clipboard.

### Disclaimer

This script uses Puppeteer to load Twitter's web interface and scroll the timeline. It may break if Twitter changes. For large accounts with thousands of tweets, you may need repeated runs or an official API solution.

### Development

```bash
# Install deps
pnpm install

# Start in dev mode
pnpm dev -- your_username

# Build
pnpm build

# Link CLI
pnpm link --global
twi your_username
```

MIT License
npm package: @johnls/consul-extra
Description: Extended commands for consul CLI
Author: John Lyon-Smith
Latest version: 1.1.2

# Extra Commands for the `consul` CLI

## Summary

This tool provides some extra features to the `consul` command line tool. Install it globally with `npm install consul-extra` and run it with `consul-extra`.

This tool exposes the functionality of the [`consul`](https://www.npmjs.com/package/consul) library as a command line tool.

## Commands

### Key/Value

- `export` to export a tree of key/values as JSON.
- `json-export` same as `export`
- `import` to import a tree of key/values from JSON/JSON5.
- `import-json` same as `import`

### Status

- `leader` show the current raft leader
- `peers` show the current raft peers
npm package: @johnls/create-ios-icons
Description: Create iOS icons from a PDF image
Author: John Lyon-Smith
Latest version: 1.0.1

# Create iOS Icons

![GitHub package.json version](https://img.shields.io/github/package-json/v/jlyonsmith/create-ios-icons) ![Code coverage](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jlyonsmith/create-ios-icons/master/coverage.json) [![npm](https://img.shields.io/npm/dm/@johnls/create-ios-icons)](https://www.npmjs.com/package/@johnls/create-ios-icons) [![GitHub](https://img.shields.io/github/license/jlyonsmith/create-ios-icons)](https://raw.githubusercontent.com/jlyonsmith/create-ios-icons/master/LICENSE)

## Overview

This is a tool for creating all the different iOS icon sizes from a PDF template file.

## Installation

```sh
npm install -g @johnls/create-ios-icons
```

## Usage

```sh
create-ios-icons MyIcon.pdf MyIcon-Test.pdf Project/Assets.xcassets
```

This will create icon sets called `MyIcon` and `MyIcon-Test` in the `Project/Assets.xcassets` directory. Any existing assets will be overwritten.
npm package: @johnls/markdown-book
Description: A tool for collating Markdown books, whitepapers and essays
Author: John Lyon-Smith
Latest version: 1.2.0

# Markdown Book

A tool for making books, whitepapers, essays and other long documents out of a collection of Markdown files. It can:

- Collate multiple Markdown files into one document in the process
  - Adjusting all heading depths
  - Optionally adding section numbering
- Add an indented table of contents (TOC)
- Generate a PDF or just a bigger Markdown file

## Installation

Install the tool with:

```Shell
npm install markdown-book
```

or run it with:

```Shell
npx markdown-book
```

## Using It

Create a [JSON5]() document containing:

```json5
{
  title: "A Book About Nothing",
  toc: true,
  number: true,
  files: ["./part1.md", "./part2.md", "./part3.md"],
}
```

- `title` will be the top level, single `#`, for the book.
- `toc` if `true` will include a table of contents after the title.
- `number` if `true` will insert a section number in all headings in the format *1.1.1*, separated by a colon `:`.
- `files` is an array of files relative to the `.json5` file.

The tool expects [ATX headings](https://github.github.com/gfm/#atx-headings) (leading `#`'s).  If you have [Setext headings](https://github.github.com/gfm/#setext-heading) (`-` or `=` underlines) they will be ignored.

Any images that are references by local file paths will be adjusted to the new relative path to the image from the output `.md` file. URL image references will not be modified.
npm package: @johnls/monzilla
Description: A file monitoring tool that shoots lasers
Author: John Lyon-Smith
Latest version: 1.2.1

# Monzilla

An uncomplicated file monitoring tool. Use it for simple, non-Webpack or Browserify based Node.js projects that that you want to restart when files change, such as servers or games.

## Background

There are quite a few file monitoring tools out there. [nodemon](https://www.npmjs.com/package/nodemon) and [Watchman](https://facebook.github.io/watchman/) for example. However, many of them, including `nodemon` have weird rules about what files they monitor that have grown up over time, or in the case of `watchman` just too many whistles and bells.  I wanted a monitoring tool that would watch an explicit globbed list of files and restart a command when any of them changed, with no surprises, with the ability to force a restart at any time.  That's what this tool does.

## Installation

Install the tool with:

```Shell
npm install monzilla
```

or run it with:

```Shell
npx monzilla
```

Run a command as follows:

```Shell
> monzilla 'scratch/*.js' -- node scratch/test.js
[monzilla] Running command 'node scratch/test.js'
I think that I shall never see
a billboard lovely as a tree
[monzilla] Command exited cleanly
[monzilla] Waiting for file changes to restart. Control+C to exit; Control+R to restart now
```

Monzilla takes two sets of arguments.

1. A list of [globs](https://www.npmjs.com/package/glob) separated by colons. It's a good idea to quote this argument.
2. A command to run, separated from the glob argument by `--` for clarity, and because that's how [minimist](https://www.npmjs.com/package/minimist) prefers it.

If the command exits, you can run it again with `Control+R`, or by changing one of the watched glob files.  `Control+C` kills any long running process and exits.

The tool will watch files in symlinked directories, such as when a file in `npm link`ed under `node_modules`.

## About the Code

The tool is written in ES6 Javascript and transpiled with Babel.

All claims of superiority to other file monitoring tools are the sole opinion of the author.  Also, it's really hard to find a good `npm` package name that hasn't already been taken... ;)
npm package: @johnls/readline-password
Description: A simple readline for passwords
Author: John Lyon-Smith
Latest version: 1.1.0

# Readline for Passwords <!-- omit in toc -->

- [Package: `readline-password`](#package-readline-password)
  - [Class: `Interface`](#class-interface)
  - [Event: `close`](#event-close)
  - [Event: `SIGINT`](#event-sigint)
  - [Method: `close()`](#method-close)
  - [Method: `password(options, callback)`](#method-passwordoptions-callback)
  - [Method: `passwordAsync(options)`](#method-passwordasyncoptions)

## Package: `readline-password`

This is a `readline` for passwords. It has a similar interface to the Node.js [readline](https://nodejs.org/api/readline.html). Node's `readline` does not have any functionality to **not** echo the output of the `question()` method to the screen. It also has lots of other functionality such as history and tab completion that is not relevant to entering passwords.

This implementation also provides for optionally echoing the password characters to the screen as `*`.

Here is an example of the usage:

```js
import readlinePassword from "@johnls/readline-password"

const rl = readlinePassword.createInstance(process.stdin, process.stdout)

rl.on("SIGINT", () => process.exit(1))

rl.password("Password: \u{1F511} ", (password) => {
  console.log(password)
  rl.close()
  process.stdin.unref() // Do this only when we are all done with input
})
```

You can also use promises:

```js
import readlinePassword from "@johnls/readline-password"

const rl = readlinePassword.createInstance(process.stdin, process.stdout)

rl.on("SIGINT", () => process.exit(1))
;(async () => {
  const password = await rl.passwordAsync("Password: \u{1F511} ")

  console.log(password)
  rl.close()
  process.stdin.unref() // See above
})()
```

A call to `unref()` or something similar is needed to cause the Node.js event loop to exit, and is needed even with the built-in `readline` package.

### Class: `Interface`

Construct with a call to `createInterface()` or with `new Interface()`.

### Event: `close`

Occurs when:

- The `close()` method is called

### Event: `SIGINT`

Occurs when:

- The user types **Control+C** while entering a password

### Method: `close()`

Closes the `Interface` and relinquishes control over the `input` and `output` streams.

### Method: `password(options, callback)`

If `options` is a string, displays it as the text prompt and begins receiving a password. When the user hits **Enter** or **Return** the `callback()` function is called. This method follows the standard node convention of `(err, value) => ...` where value is the entered password string. `err` will always be `null`. This allows the call to be wrapped with `util.promisify()`.

If `options` is an object it can contain:

- `prompt`. String to display for the prompt
- `echo`. Whether to echo a `*` everytime an character is entered

The only editing that is supported is **Backspace** to delete the last character entered, and **Control+V** or **Command+V** to paste a password.

### Method: `passwordAsync(options)`

Like `password()` but returns a `Promise`.
npm package: @johnls/stream-utils
Description: A collection of stream utilities
Author: John Lyon-Smith
Latest version: 1.1.0

# Stream Utilities

Contains a collection of [Node.js Stream](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html) utilities.

- `stringToStream` - Create a `Readable` from a string
- `pipeToPromise` - `pipe` between a `Readable` and `Writable` stream returning a `Promise`
- `streamToBuffer` - Read a `Readable` into a `Buffer`.
npm package: @johnls/whitespace
Description: Line ending and beginning-of-line whitespace space correction tools
Author: John Lyon-Smith
Latest version: 1.2.1

# Whitespace Tools

Tools to normalize end-of-line (EOL) & beginning-of-line (BOL) whitespace in text files.

## Installation

Install the tools with:

```
npm install whitespace-tools
```

This will install the `spacer` and `ender` tools. Or run the latest version directly from [npmjs.org](https://nodejs.org) with:

```
npx -p whitespace-tools spacer ...
npx -p whitespace-tools ender ...
```

## Ender

The `ender` tool will normalize line endings.  Run `ender --help` for a list of options.

Run with a file name or pipe a file into the tool to get information on current line endings:

```
ender src/mySourceFile.js
cat someTextFile.txt | ender
```

To convert a file, supply `--new-eol` as one of `cr`, `lf`, `crlf` or `auto`.  If no `-output-file` option is given, the file will go to STDOUT.

## Spacer

The `spacer` tool will normalize line beginnings, up to the first non-whitespace character.  Run `spacer --help` for options.

Run with a file name or pipe a file into the tool to get information on current line beginnings:

```
spacer src/mySourcFile.js
cat someTextFile.txt | spacer
```

You can supply the `--new-bol` argument with either `spaces`, `tabs` or `auto`.  If the file has existing tabs, supply the `--tab-size` argument indicating how many spaces a tab represents. If `tabs` is supplied as `--new-bol`, supply the `--round` flag if you wish extra spaces to be rounded down to a whole tab.  Without this flag, the outputted file will still be reported as having `mixed` BOL's if there are any odd spaces in the BOL's.

## About This project

I've implemented this project in C#, Ruby, Python and now Javascript as a way to learn new programming languages, and also because they are _really useful tools_!  A search across projects in GitHub will reveal just how many files have mixtures of tabs & spaces at line BOL's.  Line ending problems are a little rarer these days, but they do still occur from time-to-time.  

The project is written in ES6 Javascript and cross compiled using Babel.  It currently targets Node 8.  PR's welcome for any enhancements.
npm package: @johnmakridis/ngx-ace-editor
Description: This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.
Author: John Makridis
Latest version: 15.2.0

# NgxAceEditor

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.0.

## Code scaffolding

Run `ng generate component component-name --project NgxAceEditor` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project NgxAceEditor`.
> Note: Don't forget to add `--project NgxAceEditor` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build NgxAceEditor` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build NgxAceEditor`, go to the dist folder `cd dist/ngx-ace-editor` and run `npm publish`.

## Running unit tests

Run `ng test NgxAceEditor` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
npm package: @johnmmackey/gcal
Description: Google Calendar Helper functions
Author: John Mackey
Latest version: 1.0.1

# ms-utils

Google Calendar client functions

Due to the use of ES6 features, this module **requires Node.js V8 or above**.

## Quick Start

```shell
npm install @johnmmackey/gcal
```

```javascript

```
## Future
* tbd
npm package: @johnnren/openclaw-hook-advanced-bootstrap
Description: OpenClaw hook: configurable bootstrap content injection with per-agent filtering
Author: johnnren
Latest version: 1.0.0

# OpenClaw Hook: Advanced Bootstrap

Configurable bootstrap content injection with per-agent filtering.

## Features

- **Config-driven sources:** Multiple source paths with glob support
- **Template variables:** `{agentId}`, `{workspace}`, `{date}`, `{yesterday}`, etc.
- **Per-agent filtering:** `include` / `exclude` arrays per source
- **Include syntax:** `{{include:path}}` in bootstrap files

## Install

```bash
npm install openclaw-hook-advanced-bootstrap
```

## Configuration

```json
{
  "hooks": {
    "internal": {
      "entries": {
        "advanced-bootstrap": {
          "enabled": true,
          "sources": [
            {
              "path": "~/.openclaw/shared/bootstrap/*.md",
              "mode": "prepend"
            }
          ]
        }
      }
    }
  }
}
```

See [HOOK.md](./HOOK.md) for full documentation.

## License

MIT
npm package: @johnny-joster/n9e-plugin
Description: Nightingale alert platform query plugin for OpenClaw
Author: Youdao
Latest version: 1.0.10

# N9e Plugin for OpenClaw

夜莺(Nightingale)告警平台查询插件,支持通过自然语言查询告警事件、历史告警、告警规则和告警屏蔽配置。

## 功能特性

- ✅ 查询当前活跃告警
- ✅ 查询历史告警记录
- ✅ 查询告警规则配置
- ✅ 查询告警屏蔽规则
- ✅ 自然语言交互
- ✅ 全局查询(跨所有业务组)
- ✅ 完善的错误处理

## 快速开始

### 1. 安装插件

```bash
# 从本地目录安装(开发模式)
openclaw plugins install -l ./n9e-plugin

# 或从npm安装
openclaw plugins install @youdao/n9e-plugin
```

### 2. 配置插件

编辑OpenClaw配置文件,添加以下配置:

```json
{
  "plugins": {
    "entries": {
      "n9e-plugin": {
        "enabled": true,
        "config": {
          "apiBaseUrl": "https://n9e-dev.inner.youdao.com/api/n9e",
          "apiKey": "your-api-key-here",
          "timeout": 30000
        }
      }
    }
  }
}
```

### 3. 重启Gateway

```bash
openclaw gateway restart
```

### 4. 验证安装

```bash
openclaw plugins list
```

## 使用示例

与Agent对话即可使用:

```
用户: 查一下最近的告警
→ Agent调用 n9e_query_active_alerts
→ 返回: 当前有5条活跃告警...

用户: 昨天有哪些告警
→ Agent调用 n9e_query_historical_alerts
→ 返回: 昨天共有15条告警...

用户: CPU相关的告警规则
→ Agent调用 n9e_query_alert_rules
→ 返回: 找到3条CPU相关规则...

用户: 哪些告警被屏蔽了
→ Agent调用 n9e_query_alert_mutes
→ 返回: 当前有2条屏蔽规则...
```

## API Tools

### 1. n9e_query_active_alerts

查询当前活跃告警。

**参数:**
- `severity`: 严重级别(1=严重,2=警告,3=提示)
- `rule_name`: 规则名称(支持模糊匹配)
- `limit`: 返回数量(默认50)
- `query`: 搜索关键词

### 2. n9e_query_historical_alerts

查询历史告警记录。

**参数:**
- `severity`: 严重级别
- `rule_name`: 规则名称
- `stime`: 开始时间戳(秒)
- `etime`: 结束时间戳(秒)
- `limit`: 返回数量(默认50)

### 3. n9e_query_alert_rules

查询告警规则配置。

**参数:**
- `rule_name`: 规则名称
- `datasource_ids`: 数据源ID列表
- `disabled`: 规则状态(0=启用,1=禁用)
- `limit`: 返回数量(默认50)

### 4. n9e_query_alert_mutes

查询告警屏蔽规则。

**参数:**
- `query`: 搜索关键词
- `limit`: 返回数量(默认50)

## 项目结构

```
n9e-plugin/
├── openclaw.plugin.json    # 插件清单
├── package.json
├── index.ts                 # 插件入口
├── src/
│   ├── config-schema.ts     # Zod配置Schema
│   ├── n9e-client.ts       # 夜莺API客户端
│   ├── types.ts            # TypeScript类型定义
│   └── tools/              # 工具实现
│       ├── active-alerts.ts
│       ├── historical-alerts.ts
│       ├── alert-rules.ts
│       └── alert-mutes.ts
└── skills/                  # Agent技能
    ├── query-active-alerts/
    ├── query-historical-alerts/
    ├── query-alert-rules/
    └── query-alert-mutes/
```

## 开发

### 安装依赖

```bash
npm install
```

### 链接模式开发

```bash
npm run dev
# 等同于: openclaw plugins install -l .
```

### 类型检查

```bash
npx tsc --noEmit
```

## 配置说明

| 字段 | 类型 | 必需 | 说明 |
|------|------|------|------|
| `apiBaseUrl` | string | ✅ | 夜莺API地址 |
| `apiKey` | string | ✅ | API访问密钥 |
| `timeout` | number | ❌ | 请求超时(毫秒),默认30000 |

## 错误处理

| 错误类型 | 提示信息 |
|---------|---------|
| 网络错误 | 无法连接到夜莺平台,请检查网络或配置 |
| 401/403 | 认证失败,请检查API Key配置 |
| 404 | 未找到指定的资源 |
| 500 | 夜莺服务器错误,请稍后重试 |
| 超时 | 请求超时,请检查网络连接 |

## 许可证

MIT

## 作者

Youdao DevOps Team
npm package: @johnny.reina/convert-srt
Description: Convert SRT file to JS objects
Author: Johnny Reina
Latest version: 0.2.1

# SRT Converter [![npm (scoped)](https://img.shields.io/npm/v/@johnny.reina/convert-srt)](https://www.npmjs.com/package/@johnny.reina/convert-srt)
*Convert .srt subtitle files to JavaScript objects*

## Installing
```
npm i @johnny.reina/convert-srt
```

## Usage

### `toSrt(srt: string): Array<Subtitle>`
The main export of this package. Accepts the string contents of a `.srt` file and returns an array of `Subtitle` objects.


### `toWebVTT(subs: Array<Subtitle>): string`
Accepts an array of `Subtitle` objects and returns a WebVTT string.

### `Subtitle`
```typescript
interface Subtitle {
    index: number;
    from: string;
    to: string;
    text: string;
}
```
npm package: @johnny.reina/express-troll
Description: An Express middleware to redirect common admin or login paths to a custom URL. Rickrolls by default.
Author: Johnny Reina
Latest version: 1.0.1

# express-troll

An Express middleware to redirect common admin or login paths to a custom URL. Rickrolls by default.

Inspired by [a tweet](https://twitter.com/LiamHammett/status/1260984553570570240). Because why not.

## Installing

```bash
npm i @johnny.reina/express-troll
```

## Using

```javascript
const app = express();
const { troll } = require("@johnny.reina/express-troll");

app.use(troll()); // Will redirect to https://www.youtube.com/watch?v=dQw4w9WgXcQ
// OR specify a URL
app.use(troll("https://example.com"));
```

## Which paths get redirected?
The list can be found [here](./src/paths.js)

## License?
[MIT](./LICENSE)
npm package: @johnny.reina/json-db
Description: File-system database
Author: Johnny Reina
Latest version: 2.0.5

# Basic JSON DB

## Installing
```bash
npm i @johnny.reina/json-db
```

## Usage
```typescript
import { Database } from '@johnny.reina/json-db';

type Book = { _id?: string, title: string, author: string };

const collection = new Database('my-db').collection<Book>('my-collection');
```
This will create a file at `%HOMEDIR%/.my-db/my-collection.json` containing an empty array.

### `Collection<T>.insert(obj: T): Promise<string>`
Insert an item to the collection. Note that this will add an `_id` property.

### `Collection<T>.insertMany(obj: Array<T>): Promise<Array<string>>`
Insert an array of items to the collection. Note that this will add an `_id` property to each item.

### `Collection<T>.read(): Promise<Array<T>>`
Returns the entire contents of the collection.

### `Collection<T>.read(predicate: (item: T) => boolean): Promise<Array<T>>`
Returns the collection items for which the supplied predicate function returns `true`.

### `Collection<T>.find(id: string): Promise<T>`
Returns the collection item with the specified `_id`.

### `Collection<T>.find(predicate: (item: T) => boolean): Promise<T>`
Returns the collection item for which the supplied predicate function returns `true`.

### `Collection<T>.update(obj: T): Promise<void>`
Finds the collection item matching the provided object's `_id` property and replaces it with the supplied object.

### `Collection<T>.delete(id: string): Promise<void>`
Delete an object by id.

### `Collection<T>.delete(predicate: (item: T) => boolean): Promise<void>`
Deletes the collection **items** for which the supplied predicate function returns `true`.

## License
MIT
npm package: @johnny2022/web3-provider
Description: Web3 provider
Author: johnnycheungq@gmail.com
Latest version: 0.0.38

# @johnny2022/web3-provider
A commonplace web3 provider. Use it to sign and send transactions, to retrieve data, and generate accounts.

## Install

```
$ npm install @johnny2022/web3-provider --save
```

## Examples

Initialize with mnemonic
```javascript
const Web3 = require("web3");
const Web3Provider = require("@johnny2022/web3-provider");

const chainId = 1
const mnemonicPhrase = "mountains supernatural bird..."; // 12 word mnemonic
let provider = new Web3Provider({
  mnemonic: {
    phrase: mnemonicPhrase
  },
  providerOrUrl: "http://localhost:8545",
  chainSettings: { chainId }
});
```

Initialize with private key
```javascript
const Web3 = require("web3");
const Web3Provider = require("@johnny2022/web3-provider");

const chainId = 1
const privateKey = "0x000111......"; 
let provider = new Web3Provider({
  privateKeys: [
    privateKey
  ],
  providerOrUrl: "http://localhost:8545",
  chainSettings: { chainId }
});
```


Initialize with public key
```javascript
const Web3 = require("web3");
import { InitializeEthereumWithPublicKey } from "@johnny2022/web3-provider"

const chainId = 1
const publicKey = "0x000111......"; 
InitializeEthereumWithPublicKey("http://localhost:8545", chainId, publicKey);
```


Create your account and output mnemonic, private key and public key
```javascript
import { Web3Wallet } from "@johnny2022/web3-provider"

const chainId = 1
let password = "123456"
new Web3Wallet().createAccount(chainId, password)
.then(acc => {
  console.log(acc)
  // It will be output the {mnemonic: "hello world ...", publicKey: "0x0...", privateKey: "0x1..."}
})
```