open-index/open-npm huggingface dataset:
npm package: @pre-bundled/detective
Description: find all require() calls by walking the AST
Author: James Halliday
Latest version: 5.2.0-patch-1

# detective

find all calls to `require()` by walking the AST

[![build status](https://secure.travis-ci.org/browserify/detective.png)](http://travis-ci.org/browserify/detective)

# example

## strings

strings_src.js:

``` js
var a = require('a');
var b = require('b');
var c = require('c');
```

strings.js:

``` js
var detective = require('detective');
var fs = require('fs');

var src = fs.readFileSync(__dirname + '/strings_src.js');
var requires = detective(src);
console.dir(requires);
```

output:

```
$ node examples/strings.js
[ 'a', 'b', 'c' ]
```

# methods

``` js
var detective = require('detective');
```

## detective(src, opts)

Give some source body `src`, return an array of all the `require()` calls with
string arguments.

The options parameter `opts` is passed along to `detective.find()`.

## var found = detective.find(src, opts)

Give some source body `src`, return `found` with:

* `found.strings` - an array of each string found in a `require()`
* `found.expressions` - an array of each stringified expression found in a
`require()` call
* `found.nodes` (when `opts.nodes === true`) - an array of AST nodes for each
argument found in a `require()` call

Optionally:

* `opts.word` - specify a different function name instead of `"require"`
* `opts.nodes` - when `true`, populate `found.nodes`
* `opts.isRequire(node)` - a function returning whether an AST `CallExpression`
node is a require call
* `opts.parse` - supply options directly to
[acorn](https://npmjs.org/package/acorn) with some support for esprima-style
options `range` and `loc`
* `opts.ecmaVersion` - default: 9

# install

With [npm](https://npmjs.org) do:

```
npm install detective
```

# license

MIT
npm package: @pre-bundled/has-require
Description: Check if code requires any module or a specific id
Author: Ben Drucker
Latest version: 1.2.2-patch-1

# has-require [![Build Status](https://travis-ci.org/bendrucker/has-require.svg?branch=master)](https://travis-ci.org/bendrucker/has-require)

> Check if code requires any module or a specific id

## Installing

```bash
$ npm install --save has-require
```

## Usage

```js
var hasRequire = require('has-require')
hasRequire('require("foo")', 'foo') // => true
hasRequire.any('require') // => false
```

## API

For full implementation details, see the [`Checker`](#checker) API.

#### `hasRequire(code, id)` -> `boolean`

##### code

*Required*  
Type: `string`

The code to check.

##### id

*Required*  
Type: `string`

The module id to check, e.g. `'http'`.

##### `hasRequire.any(code)` -> `boolean`

#### code

*Required*  
Type: `string`

The code to check.

<hr>

### `Checker`

#### `new hasRequire.Checker(code)` -> `checker`

##### code

*Required*  
Type: `string`

The code to store on the checker.

##### `checker.any()` -> `boolean`

Checks if any string literal is required. The result is cached. The following code won't be matched:

* `require`
* `require()`
* `require('')`

##### `checker.has(id)` -> `boolean`

##### id

*Required*  
Type: `string`

The module id to check, e.g. `'http'`.

Uses `checker.any()` first, so calling `has` for multiple ids when no `require` is present (`!checker.any()`) will avoid needlessly re-testing the code.

## License

MIT © [Ben Drucker](http://bendrucker.me)
npm package: @pre-bundled/hyperswarm-replicator
Description: Replicates data structures easily using hyperswarm
Author: Mathias Buus
Latest version: 2.0.2

# @hyperswarm/replicator

Replicate data structures easily using hyperswarm

## Install

```js
npm install @hyperswarm/replicator
```

## Usage

You data structure has to support a .replicate() stream, then you can replicate
them using the hyperswarm replicator.

```js
const Replicator = require('@hyperswarm/replicator')

const r = new Replicator()

r.add(aHypercore, {
  live: true // passed to .replicate
})
```

## API

#### `r = new Replicator([options])`

Make a new replicator. Options include:

```js
{
  bootstrap: [...], // optional set the DHT bootstrap servers
}
```

#### `promise = r.add(hyperDataStructure, [options])`

Add a hyper* data structure to replicate.

```js
{
  live: bool, // passed to .replicate
  upload: bool, // passed to .replicate
  download: bool, // passed to .replicate
  encrypt: bool, // passed to .replicate
  discoveryKey: <buf>, // optionally set your own discovery key
  announce: true, // should the swarm announce you?
  lookup: true, // should the swarm do lookups for you?
  keyPair: { publicKey, secretKey }, // noise keypair used for the connection
  onauthenticate (remotePublicKey, done) // the onauthenticate hook to verify remote key pairs
}
```

Promise resolves when the data structure has been fully added.


#### `promise = r.remove(hyperDataStructure)`

Remove a data structure from replication.
Promise resolves when the data structure has been fully removed.

#### `r.swarm`

The associated hyperswarm instance.

#### `r.on('discovery-key', (discoveryKey, remoteStream) => ...)`

Emitted when a remote asks for a discovery key of a data structure you are
not currently replicating.

#### `r = Replicator.replicate(hyperDataStructure[s])`

Easy "one off" replication of one or more data structures.

## License

MIT
npm package: @pre-bundled/mkdirp
Description: Recursively mkdir, like `mkdir -p`
Author: James Halliday
Latest version: 0.5.1

# mkdirp

Like `mkdir -p`, but in node.js!

[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)

# example

## pow.js

```js
var mkdirp = require('mkdirp');
    
mkdirp('/tmp/foo/bar/baz', function (err) {
    if (err) console.error(err)
    else console.log('pow!')
});
```

Output

```
pow!
```

And now /tmp/foo/bar/baz exists, huzzah!

# methods

```js
var mkdirp = require('mkdirp');
```

## mkdirp(dir, opts, cb)

Create a new directory and any necessary subdirectories at `dir` with octal
permission string `opts.mode`. If `opts` is a non-object, it will be treated as
the `opts.mode`.

If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.

`cb(err, made)` fires with the error or the first directory `made`
that had to be created, if any.

You can optionally pass in an alternate `fs` implementation by passing in
`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and
`opts.fs.stat(path, cb)`.

## mkdirp.sync(dir, opts)

Synchronously create a new directory and any necessary subdirectories at `dir`
with octal permission string `opts.mode`. If `opts` is a non-object, it will be
treated as the `opts.mode`.

If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.

Returns the first directory that had to be created, if any.

You can optionally pass in an alternate `fs` implementation by passing in
`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and
`opts.fs.statSync(path)`.

# usage

This package also ships with a `mkdirp` command.

```
usage: mkdirp [DIR1,DIR2..] {OPTIONS}

  Create each supplied directory including any necessary parent directories that
  don't yet exist.
  
  If the directory already exists, do nothing.

OPTIONS are:

  -m, --mode   If a directory needs to be created, set the mode as an octal
               permission string.

```

# install

With [npm](http://npmjs.org) do:

```
npm install mkdirp
```

to get the library, or

```
npm install -g mkdirp
```

to get the command.

# license

MIT
npm package: @pre-bundled/replace-requires
Description: Replace require statements
Author: Ben Drucker
Latest version: 1.1.0

# replace-requires [![Build Status](https://travis-ci.org/bendrucker/replace-requires.svg?branch=master)](https://travis-ci.org/bendrucker/replace-requires)

> Replace require statements


## Install

```
$ npm install --save replace-requires
```


## Usage

```js
var replaceRequires = require('replace-requires');

replaceRequires('require("foo")', {foo: 'bar'});
//=> bar
```

## API

#### `replaceRequires(code, replacements)` -> `string`

##### code

*Required*  
Type: `string`

The code to parse and replace.

##### replacements

*Required*  
Type: `object`

The replacements, where keys are module ids and the corresponding values are the replacements for their require statements.


## License

MIT © [Ben Drucker](http://bendrucker.me)
npm package: @pre-release/gist-box
Description: A helper class for updating a single-file Gist
Author: Jason Etcovitch
Latest version: 0.3.2

<h3 align="center">GistBox</h3>
<p align="center">📌📋 A helper class for updating a single-file Gist<p>
<p align="center"><a href="https://npmjs.com/package/gist-box"><img src="https://badgen.net/npm/v/gist-box" alt="NPM"></a> <a href="https://action-badges.now.sh"><img src="https://action-badges.now.sh/JasonEtco/gist-box" alt="Build Status"></a> <a href="https://codecov.io/gh/JasonEtco/gist-box/"><img src="https://badgen.now.sh/codecov/c/github/JasonEtco/gist-box" alt="Codecov"></a></p>

## Usage

### Installation

```sh
$ npm install gist-box
```

```js
const { GistBox } = require('gist-box')
```

### API

```js
const box = new GistBox({ id, token })
await box.update({
  filename: 'example.md',
  description: 'A new description',
  content: 'The new content'
})
```

You can also import some boundary numbers to use when dealing with pinned Gists:

```js
const {
  MAX_LENGTH, // The number of characters rendered in one line
  MAX_LINES,  // The number of lines it will render
  MAX_HEIGHT, // The height of the box, in pixels
  MAX_WIDTH   // The width of the box, in pixels
} = require('gist-box')
```

---

Shoutout to [@matchai](https://github.com/matchai) for starting this trend with [bird-box](https://github.com/matchai/bird-box)!
npm package: @preachjs/datepicker
Description: Headless Datepickers for preact
Author: reaper
Latest version: 0.0.3

# @preachjs/datepicker

> Headless Datepicker(s) for preact

- [@preachjs/datepicker](#preachjsdatepicker)
  - [Highlights](#highlights)
  - [Usage](#usage)
    - [Simple Inline Datepicker](#simple-inline-datepicker)
    - [Create a range select date picker](#create-a-range-select-date-picker)
    - [API](#api)
  - [License](#license)

## Highlights

- Lightweight
- Unstyled
- Fast and runs on signals
- For [Preact](https://preactjs.com/)! <3

## Usage

- Install the package and it's deps

```sh
npm i preact @preachjs/datepicker @preact/signals
```

### Simple Inline Datepicker

```js
import { Calendar } from '@preachjs/datepicker'

function App() {
  const [date, setDate] = useState()
  return (
    <>
      <Calendar value={date} onSelect={nextValue => setDate(nextValue)} />
    </>
  )
}
```

### Create a range select date picker

```tsx
import { Calendar } from '@preachjs/datepicker'

function App() {
  const [dateRange, setDateRange] = useState([])
  return (
    <>
      <Calendar
        mode="range"
        value={dateRange}
        onSelect={nextValue => setDateRange(nextValue)}
      />
    </>
  )
}
```

### API

| prop            | description                                                                                                       | default      |
| --------------- | ----------------------------------------------------------------------------------------------------------------- | ------------ |
| `value`         | The current value of the datepicker                                                                               | current date |
| `onSelect`      | Callback fired when a date selection is successful, in case of `range` selection, it'll fire with both the values |              |
| `mode`          | Switch between single select and range selection mode                                                             | `single`     |
| `weekdayFormat` | `narrow,short,long` weekend format on the calendar header                                                         | `narrow`     |
| `arrowLeft`     | Icon Rendered on the left of the month selector                                                                   | `&lt;`       |
| `arrowRight`    | Icon Rendered on the right of the month selector                                                                  | `&gt;`       |

## License

[MIT](/LICENSE)