open-index/open-npm huggingface dataset:
npm package: @motorcycle/compiler
Description: Compiles Motorcycle applications from TypeScript to Javascript
Author: Tylor Steinberger
Latest version: 3.0.0

# @motorcycle/compiler

## Get It
```sh
npm install --save @motorcycle/compiler
# or
yarn add @motorcycle/compiler
```

## API

<details>
  <summary id=compile>compile(filePath: string): string</summary>
  <p>Takes the entry file to your Motorcycle run function away using<br>type information from the TypeScript compiler.</p>


  <p><strong>Example:</strong></p>

```typescript
import { compile } from '@motorcycle/compiler'
import * as fs from 'fs'

const filePath = './src/bootstrap.ts'

fs.writeFileSync(filePath, compile(filePath))
```

</details>
npm package: @motorcycle/core
Description: Functional and Reactive Framework
Author: Tylor Steinberger
Latest version: 2.1.0

# Motorcycle.js

[![Join the chat at https://gitter.im/cyclejs/core](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cyclejs/core?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/motorcyclejs/core.svg?branch=develop)](https://travis-ci.org/motorcyclejs/core)

This is the core of Motorcycle.js creating your applicaton loop tied together with `most.js`.
It separates your application logic into a pure (as much as JavaScript can be) function, and your
side-effectful code into drivers.

## Install
```
$ npm install @motorcycle/core
```

## Want to Contribute?

If you found an issue or want to contribute code, please read
the [contributing guidelines](CONTRIBUTING.md).

If would like to have a repository considered for inclusion in the
Motorcycle.js Github and NPM organizations, please open an issue first to avoid
duplication of effort and further the possibility of your work being accepted.
Afterwards, please refer to our [repository guidelines](REPOSITORIES.md).

## Useful Utilities
- [most-subject](https://github.com/mostjs-community/most-subject) - A subject
implementation for most.js
- [most-proxy](https://github.com/mostjs-community/most-proxy) - Declarative circular dependencies for most.js

## API

### run(main, drivers)

###### Importing
```js
import * as Motorcycle from '@motorcycle/core'

Motorcycle.run(main, drivers)

```

Takes a `main` function and circularly connects it to the given
collection of driver functions.

The `main` function takes an object of *sources* as input. Sources
are the outputs from the various drivers. To complete the cycle,
`main` should return a *sinks* object, which is a mapping
of return values from the program to the drivers, i.e., inputs
to the drivers, usually Observables/Streams.

###### Arguments:

**main** :: Function - a function that takes sources as input
and outputs a collection of sinks Observables/Streams.

**drivers** :: Object - an object where keys are driver names
and values are driver functions.

###### Return:

(Object) an object containing *sources*, *sinks*, and *dispose()* that
can be used for debugging or testing.

  *sources :: Object<most.Stream>* - The collection that is passed to your main function. The output of the drivers passed to run()

  *sinks :: Object<most.Stream>* - The collection that is returned from your main function. The input to the drivers.

  *dispose :: Function* - A function that will dispose of streams from sinks and sources.

[motorcycle-dom]: https://github.com/motorcyclejs/motorcycle-dom
[contributing]: https://github.com/motorcyclejs/motorcycle/blob/master/CONTRIBUTING.md
npm package: @motorcycle/firebase
Description: Firebase Drivers for Motorcycle.js
Author: Tylor Steinberger
Latest version: 2.0.0

# @motorcycle/firebase

> Firebase drivers for Motorcycle.js

This is a collection of drivers for interacting with Firebase. Currently only
Firebase Authentication has been implemented, but more will be made in the future.

## Let me have it!
```sh
npm install --save @motorcycle/firebase
```

## Drivers

- [x] Firebase Authentication Driver
- [ ] Firebase Database Driver
- [ ] Firebase Queue Driver
- [ ] Firebase Storage Driver

## API

#### `makeFirebaseAuthenticationDriver(firebase: FirebaseInstance): FirebaseDriver`

```typescript
import { run } from '@motorcycle/core'
import { makeFirebaseAuthenticationDriver } from '@motorcycle/firebase'
import * as firebase from 'firebase';

run(main, {
  authentication$: makeFirebaseAuthenticationDriver(firebase);
});
```

## Types

#### `FirebaseDriver :: (sink$: Stream<AuthenticationType>) => Stream<Authentication>`

```typescript
import { REDIRECT } from '@motorcycle/firebase';

function main (sources) {
  const user$ = sources.authentication$.map(authentication =>
    authentication.userCredential.user);

  return {
    authentication$: sources.DOM.select('#auth').events('click').constant(GoogleAuth)
  }
}

const GoogleAuth = { method: REDIRECT, provider: new firebase.auth.GoogleProvider() }
```

#### `Authentication`

```typescript
export type Authentication = {
  error: AuthenticationError | null;
  userCredential: firebase.User;
};
```

#### `AuthenticationError`

Extends built-in error type with extra property `code` which represents a
firebase error code.

#### `AuthenticationType`

Dealing with these strings for each `method` is a pain, and easily
open for common typos constants are provided to help you with this. Their
imports are shown with each authentication type.

```typescript
export type AuthenticationType =
  AnonymousAuthentication |
  EmailAndPasswordAuthentication |
  PopupAuthentication |
  RedirectAuthentication |
  SignOutAuthentication |
  CreateUserAuthentication |
  GetRedirectResultAuthentication;

import { ANONYMOUSLY } from '@motorcycle/firebase';

export interface AnonymousAuthentication {
  method: 'ANONYMOUSLY';
}

import { EMAIL_AND_PASSWORD } from '@motorcycle/firebase';

export interface EmailAndPasswordAuthentication {
  method: 'EMAIL_AND_PASSWORD';
  email: string;
  password: string;
}

import { POPUP } from '@motorcycle/firebase';

export interface PopupAuthentication {
  method: 'POPUP';
  provider: firebase.auth.AuthProvider;
}

import { REDIRECT } from '@motorcycle/firebase';

export interface RedirectAuthentication {
  method: 'REDIRECT';
  provider: firebase.auth.AuthProvider;
}

import { SIGN_OUT } from '@motorcycle/firebase';

export interface SignOutAuthentication {
  method: 'SIGN_OUT';
}

import { CREATE_USER } from '@motorcycle/firebase';

export interface CreateUserAuthentication {
  method: 'CREATE_USER';
  email: string;
  password: string;
}

import { GET_REDIRECT_RESULT } from '@motorcycle/firebase';

export interface GetRedirectResultAuthentication {
  method: 'GET_REDIRECT_RESULT';
}
```
npm package: @motorcycle/html
Description: Motorcycle.js HTML Driver
Author: Tylor Steinberger
Latest version: 1.1.3

# Motorcycle HTML Driver [![Build Status](https://travis-ci.org/motorcyclejs/html.svg?branch=develop)](https://travis-ci.org/motorcyclejs/html) [![Motorcycle.js](https://img.shields.io/badge/Motorcycle.js-compatible-brightgreen.svg)](https://github.com/motorcyclejs)

This is the standard HTML driver for Motorcycle built using [snabbdom-to-html](https://github.com/acstll/snabbdom-to-html).

## Installing
```
$ npm install @motorcycle/html
```

## Want to Contribute?

If you found an issue or want to contribute code, please read
the [contributing guidelines](https://github.com/motorcyclejs/motorcycle/blob/master/CONTRIBUTING.md).

## Example Usage
```js
import {run} from '@motorcycle/core'
import {h2} from '@motorcycle/dom'
import htmlDriver from '@motorcycle/html'

function app(sources) {
  ...
  return {
    HTML: most.just(h2('Hello, world!'))
  }
}

const {sources} = run(app, {
  HTML: htmlDriver,
})

sources.HTML.select(':root').observable.observe(html => {...})
```

## API

### htmlDriver(source$)

htmlDriver is a function which takes a stream of Snabbdom virtual nodes and returns a stream of HTML strings.

###### Arguments

**source$ :: most.Stream** - A stream of Snabbdom virtual nodes.

###### Returns

(Object): An object with a single method `select()`.

**select()** :: Function - A function which return as an object containing `observable` and `events()`.

  **observable** :: most.Stream - A stream of HTML strings.

  **events()** :: Function - A function which returns an empty stream for compatibility with the DOM driver API.
npm package: @motorcycle/loader
Description: Webpack Loader for Motorcycle
Author: Tylor Steinberger
Latest version: 3.0.0

# @motorcycle/loader

This loader makes use of [`@motorcycle/compiler`](https://github.com/motorcyclets/compiler) to
make compile-time optimizations of Motorcycle constructs.

## Install
```sh
yarn add --dev @motorcycle/loader
# or
npm install --save-dev @motorcycle/loader
```

## Motorcycle Starter

This loader and other webpack optimizations are configured for you in our very 
own Motorcycle starter application, which can be found [here](https://github.com/motorcyclets/starter).

## Usage

To make use of this loader you only need to add `@motorcycle/loader` before 
`ts-loader` in your webpack configuration with some configuration.

```typescript
// webpack.config.js
const entry = 'src/bootstrap.ts'

module.exports = {
  entry,
  module: {
    rules: [
      {
        test: /\.ts$/,
        use: [
          {
            loader: '@motorcycle/loader',
            options: {
              entries: [ entry ]
            }
          },
          'ts-loader'
        ],
        exclude: /node_modules/
      }
    ]
  },
  // other configuration options
}
```

## Options

#### `entries: Array<string>`

Entries are paths, relative or absolute, to the part(s) of your application that 
have calls to `run` from `@motorcycle/run`.
npm package: @motorcycle/mostly-html
Description: Server-side rendering for Motorcycle.ts
Author: Tylor Steinberger
Latest version: 1.0.0

# @motorcycle/mostly-html -- 0.0.0

Server-side rendering for Motorcycle.ts

## Get it
```sh
yarn add @motorcycle/mostly-html
# or
npm install --save @motorcycle/mostly-html
```

## API Documentation

All functions are curried!

#### 

<p>



</p>


```typescript

export type HtmlSources<A = Element, B = Event> = {
  readonly html$: Stream<HtmlString>
  readonly dom: DomSource<A, B>
}

```


#### Html\<A = Element, B = Event\>(sinks: HtmlSinks): HtmlSources\<A, B\>

<p>

Renders mostly-dom VNodes into HTML for server-side rendering.

</p>


<details>
  <summary>See an example</summary>
  
```typescript
import { run } from '@motorcycle/run'
import { Html, HtmlSources, HtmlSinks } from '@motorcycle/mostly-html'
import { UI } from './UI'
import { observe } from '@motorcycle/stream'

const { sources: { html$ } } = run<HtmlSources, HtmlSinks>(UI, Html)

observe((html: string) => { /* Do something with html *\/ }, html$)
```

</details>

<details>
  <summary>See the code</summary>

```typescript

export function Html<A = Element, B = Event>(sinks: HtmlSinks): HtmlSources<A, B> {
  const { view$ } = sinks

  const html$ = hold(map(toHtml, view$))
  const dom = new HtmlDomSource<A, B>([])

  return { dom, html$ }
}

```

</details>

<hr />


#### HtmlSinks

<p>



</p>


```typescript

export type HtmlSinks = {
  readonly view$: Stream<VNode>
}

```
npm package: @motorcycle/run
Description: A statically-typed, functional and reactive framework for modern browsers
Author: Tylor Steinberger
Latest version: 5.0.0

# @motorcycle/run -- 4.1.0

A statically-typed, functional and reactive framework for modern browsers

## Get it
```sh
yarn add @motorcycle/run
# or
npm install --save @motorcycle/run
```

## API Documentation

All functions are curried!

#### run\<Sources, Sinks\>(Main: Component\<Sources, Sinks\>, IO: IOComponent\<Sinks, Sources\>)

<p>

Gets the Motorcycle engine roaring! This is the core of Motorcycle. It
creates an application loop between your purely functional `Main` function, and your
side-effectful `IO` function using [`@most/core`](https://github.com/mostjs/core).

This is made possible by the use of the ES2015 Proxy. This means that Motorcycle
will only support modern browsers with this feature. All major browsers, still
supported by their vendors(Google, Microsoft, Apple), support this feature.

</p>


<details>
  <summary>See an example</summary>
  
```typescript
import { run } from '@motorcycle/run'
import { makeDomComponent, div, button, h2, query, clickEvent } from '@motorcycle/dom'

function Main(sources) {
  const { dom } = sources

  const click$ = clickEvent(query('button', dom))

  const count$ = scan(x => x + 1, click$)

  const view$ = map(view, count$)

  return { view$ }
}

function view(count: number) {
  return div([
    h2(`Clicked ${count} times`),
    button('Click Me'),
  ])
}

run(Main, makeDomComponent(document.querySelector('#app')))
```

</details>

<details>
  <summary>See the code</summary>

```typescript

export function run<
  Sources extends Readonly<Record<string, any>>,
  Sinks extends Readonly<Record<string, Stream<any>>>
>(Main: Component<Sources, Sinks>, IO: IOComponent<Sinks, Sources>) {
  const { stream: endSignal } = createProxy<void>()

  const sinkProxies = {} as Record<keyof Sinks, ProxyStream<any>>
  const proxySinks: Sinks = createProxySinks(sinkProxies, endSignal)
  const sources: Sources = IO(proxySinks)
  const sinks: Sinks = createDisposableSinks(Main(sources), endSignal)

  const disposable = replicateSinks(sinks, sinkProxies)

  function dispose() {
    endSignal.event(scheduler.currentTime(), void 0)
    disposable.dispose()
    disposeSources(sources)
  }

  return { sinks, sources, dispose }
}

```

</details>

<hr />
npm package: @motorcycle/tslint
Description: TSLint for Motorcycle.js Projects
Author: Tylor Steinberger
Latest version: 3.1.0

# Motorcycle TSLint Configuration

TSLint Configuration for Motorcycle.js

## Let me have it!
```sh
npm install --save-dev @motorcycle/tslint
```

## Use it
```typescript
// tslint.json
{
  "extends": [
    "@motorcycle/tslint"
  ]
}
```
npm package: @motorina0/ecpair
Description: Client-side Bitcoin JavaScript library ECPair
Latest version: 2.0.2

# ecpair
[![Github CI](https://github.com/bitcoinjs/ecpair/actions/workflows/main_ci.yml/badge.svg)](https://github.com/bitcoinjs/ecpair/actions/workflows/main_ci.yml) [![NPM](https://img.shields.io/npm/v/ecpair.svg)](https://www.npmjs.org/package/ecpair) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

A library for managing SECP256k1 keypairs written in TypeScript with transpiled JavaScript committed to git.

## Example

TypeScript

``` typescript
import { Signer, SignerAsync, ECPairInterface, ECPairFactory, ECPairAPI, TinySecp256k1Interface } from 'ecpair';
import * as crypto from 'crypto';

// You need to provide the ECC library. The ECC library must implement 
// all the methods of the `TinySecp256k1Interface` interface.
const tinysecp: TinySecp256k1Interface = require('tiny-secp256k1');
const ECPair: ECPairAPI = ECPairFactory(tinysecp);

// You don't need to explicitly write ECPairInterface, but just to show
// that the keyPair implements the interface this example includes it.

// From WIF
const keyPair1: ECPairInterface = ECPair.fromWIF('KynD8ZKdViVo5W82oyxvE18BbG6nZPVQ8Td8hYbwU94RmyUALUik');
// Random private key
const keyPair2 = ECPair.fromPrivateKey(crypto.randomBytes(32));
// OR (uses randombytes library, compatible with browser)
const keyPair3 = ECPair.makeRandom();
// OR use your own custom random buffer generator BE CAREFUL!!!!
const customRandomBufferFunc = (size: number): Buffer => crypto.randomBytes(size);
const keyPair4 = ECPair.makeRandom({ rng: customRandomBufferFunc });
// From pubkey (33 or 65 byte DER format public key)
const keyPair5 = ECPair.fromPublicKey(keyPair1.publicKey);

// Pass a custom network
const network = {}; // Your custom network object here
ECPair.makeRandom({ network });
ECPair.fromPrivateKey(crypto.randomBytes(32), { network });
ECPair.fromPublicKey(keyPair1.publicKey, { network });
// fromWIF will check the WIF version against the network you pass in
// pass in multiple networks if you are not sure
ECPair.fromWIF('wif key...', network);
const network2 = {}; // Your custom network object here
const network3 = {}; // Your custom network object here
ECPair.fromWIF('wif key...', [network, network2, network3]);
```

## LICENSE [MIT](LICENSE)
Written and tested by [bitcoinjs-lib](https://github.com/bitcoinjs/bitcoinjs-lib) contributors since 2014.