open-index/open-npm huggingface dataset:
npm package: @hollwann/cycle-router
Description: cycle-router is a driver for Cycle.js that allows to add multiple views and handle routing.
Author: hollwann
Latest version: 0.0.2

# cycle-router

![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)

cycle-router is a driver for Cycle.js that allows to add multiple views and handle routing.

- Navigate with path or name
- BeforeEach hook
- Hash mode

### Installation

```sh
$ npm install @hollwann/cycle-router
```

### Usage

The usage is as simple as any other driver, here is an example of the main function using cycle-router.

```javascript
import { makeDOMDriver } from '@cycle/dom'
import makeRouterDriver from '@hollwann/cycle-router'
import routerConfig from './routerConfig'
import run from '@cycle/run'

const main = (sources) => {
  const routerView = sources.router.currentView(sources)

  const sinks = {
    DOM: routerView.select('DOM'),
    router: routerView.select('router')
  }
  return sinks
}

const drivers = {
  DOM: makeDOMDriver('#app'),
  router: makeRouterDriver(routerConfig)
}
run(main, drivers)
```

You pass all the sources to your view and then you get the sinks returned. With `routerView.select` you can get any sink you get from that view.

You must specify a configuration file which should look like this.

```typescript
import Home from './views/Home'
import Login from './views/Login'

const routes = [
  {
    path: '/',
    name: 'home',
    view: Home,
    meta: {
      /*meta prop is optional*/ requiresAuth: true
    }
  },
  {
    path: '/login',
    name: 'login',
    view: Login
  }
]

const beforeEach = (routeTo) => {
  //This is just an example
  const currentUser = 'user' //some valid user here
  const authRequired = routeTo.meta.authRequired

  if (authRequired && currentUser) return { name: RouteTo.name }
  else if (authRequired && !currentUser) return { name: 'login' }
  return { name: routeTo.name }
}
export default { routes, defaultView: Home, /*optional*/ beforeEach }
```

`beforeEach` is an optional function, which is executed before entering a new route.

You can navigate passing a stream of objects to the router sink, whit the name of the route or ther path. A simple example could be:
`xs.of({name:'home'})`


## License

[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2020, Hollwann
npm package: @hollway/node-selection
Description: Get current selected text by using system accessibility APIs
Author: Movelocity
Latest version: 0.2.1

# node-selection

> Get current selected text by using system accessibility APIs.

This project is forked from [node-selection](https://github.com/lujjjh/node-selection)

**What is New**
- Enlarge the text selection range, no 256 characters limit.
- Support text selection in more scenarios such as eletcron, vscode, cursor, etc. You just need to run the program with administrator privileges.

## Installation

- npm
```sh
npm install @hollway/node-selection
```

- yarn 
```sh
yarn add @hollway/node-selection
```

## Usage

### Accessibility permissions

macOS requires accessibility permissions to be granted before a program
can control the Mac by using accessibility features.

#### `checkAccessibilityPermissions([options])`

- `options`: `<Object>`
  - `prompt`: `<boolean>` **Default:** `false`

Returns: `<Promise>` Fullfills upon success with a boolean indicating
whether accessibility permissions have been granted to this program.

If `prompt` is `true`, a prompt window will be shown when accessibility
permissions have not been granted.

If this method is invoked on non-macOS platform, it always returns `true`.

```js
import { checkAccessibilityPermissions } from '@hollway/node-selection';

if (!(await checkAccessibilityPermissions({ prompt: true }))) {
  console.log('grant accessibility permissions and restart this program');
  process.exit(1);
}
```

### Selection

#### `getSelection()`

Returns: `<Promise>` Fullfills upon success with an object with one property:

- `text`: `<string>` | `<undefined>` Current selected text.
- `process`: `Object` | `<undefined>`
  - `pid`: `<number>` | `<undefined>` The process ID.
  - `name`: `<string>` | `<undefined>` The filename of the process.
  - `bundleIdentifier`: `<string>` | `<undefined>` The bundle identifier of the process (macOS only).

```js
import { getSelection } from '@hollway/node-selection';

try {
  const { text, process } = await getSelection();
  console.log('current selection:', { text, process });
} catch (error) {
  // no valid selection
  console.error('error', error);
}
```

## Examples

- [Node](example/node-example)
- [Electron](example/electron-example)

# Development Guide

## Prerequisites
- For windows, open `Visual Studio Installer` and click `Modify` to install the C++ Desktop Development Kit: v143 C++ ATL(x86/x64)

## Rebuild C++ Module
C++ code is under `src/`, if you changed the code, use the following command to rebuild.
```sh
npm run build
```
npm package: @hollyit/boot-mix
Description: A simple helper to run Laravel Mix in monorepo environments.
Author: Jamie Holly
Latest version: 1.0.0

# boot-mix
A simple helper to make working with Yarn Workspaces and Laravel Mix much simpler.

## What does this solve?

When working with monorepos, utilizing tools such as Yarn Workspaces, Laravel
Mix usually breaks. The problem occurs from Webpack and Mix files being
stored in the parent node_modules and a child package not being able to
resolve the location. Take this typical package.json script from a Laravel Mix
package:

`{"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"}`

When you execute the development script Node will search for the webpack.js file
in the node_modules folder relative to the package.json, however if you're
in a situation where Webpack and/or Mix are hoisted to an upper directory,
the script will cause an error.

## Using this script

First you must require this package in your packages.json

`yarn add -D @hollyit/boot-mix`

Once added, the next step is to update your package.json mix scripts. First replace:

`node_modules/webpack/bin/webpack.js`

With

`mix`

Second you can remove the --config argument:

`--config=node_modules/laravel-mix/setup/webpack.config.js`

After that you can normally run your mix scripts without the errors.

## Customizing the location of webpack.config.js

By default this script will look for the webpack.config.js in the following
locations:

- A package.json customized location
- The node_modules directory relative to the package.json
- The node_modules directory used in the workspace.

You can offer a customized webpack.config.js file by added a "mixConfig"
property to your package.json. This file location is relative to the
local package.json (where your scripts section is located). It may
also be a relative location.

## License

Boot Mix is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).