open-index/open-npm huggingface dataset:
npm package: @newrelic/fn-inspect
Description: Retrieve function name and line number from a function reference
Author: Contrast Security
Latest version: 4.4.0

# @newrelic/fn-inspect

[![Test](https://github.com/newrelic-forks/node-fn-inspect/actions/workflows/test.yml/badge.svg)](https://github.com/newrelic-forks/node-fn-inspect/actions/workflows/test.yml)

This module exposes some useful information about functions from the v8 engine,
including:

- file and line number given a function reference

## Usage

Getting details about a function:

```js
const { funcInfo } = require('@newrelic/fn-inspect');

function testFn() {}

const results = funcInfo(testFn);
// => { lineNumber: 2, column: 15, file: 'example.js', method: 'testFn', type: 'Function' }
```

## Building locally

`npm run build` will build the project for your current OS and architecture.

## Publishing

Simply run `npm version` and then invoke the `release` workflow. You can run
`release` using the github UI or, if you have the github CLI installed, you
can run `gh workflow run release.yml`.
npm package: @newrelic/ritm
Description: Module to hook into the Node.js require function
Author: Thomas Watson Steen
Latest version: 7.2.0
Deprecated: This package is no longer supported.

# @newrelic/ritm

Hook into the Node.js `require` function. This allows you to modify
modules on-the-fly as they are being required.

## Installation

```
npm install @newrelic/ritm --save
```

## Usage

```js
const path = require('path')
const { Hook } = require('@newrelic/ritm')

// Hook into the express and mongodb module
new Hook(['express', 'mongodb'], function (exports, name, basedir) {
  const version = require(path.join(basedir, 'package.json')).version

  console.log('loading %s@%s', name, version)

  // expose the module version as a property on its exports object
  exports._version = version

  // whatever you return will be returned by `require`
  return exports
})
```

## API

The `@newrelic/ritm` module exposes a single function:

### `hook = new Hook([modules][, options], onrequire)`

When called a `hook` object is returned.

Arguments:

- `modules` &lt;string[]> An optional array of module names to limit which modules
  trigger a call of the `onrequire` callback. If specified, this must be the
  first argument. Both regular modules (e.g. `react-dom`) and
  sub-modules (e.g. `react-dom/server`) can be specified in the array.
- `options` &lt;Object> An optional object containing fields that change when the
  `onrequire` callback is called. If specified, this must be the second
  argument.
  - `options.internals` &lt;boolean> Specifies whether `onrequire` should be called
    when module-internal files are loaded; defaults to `false`.
- `onrequire` &lt;Function> The function to call when a module is required.

The `onrequire` callback will be called the first time a module is
required. The function is called with three arguments:

- `exports` &lt;Object> The value of the `module.exports` property that would
  normally be exposed by the required module.
- `name` &lt;string> The name of the module being required. If `options.internals`
  was set to `true`, the path of module-internal files that are loaded
  (relative to `basedir`) will be appended to the module name, separated by
  `path.sep`.
- `basedir` &lt;string> The directory where the module is located, or `undefined`
  for core modules.

Return the value you want the module to expose (normally the `exports`
argument).

### `hook.unhook()`

Removes the `onrequire` callback so that it will not be triggerd by
subsequent calls to `require()`.

## License

[MIT](https://github.com/elastic/require-in-the-middle/blob/master/LICENSE)
npm package: @newrelic/rrdom
Description: `rrdom` is a virtual dom library that is used by `rrweb` to replay DOM mutations. It is a standalone library that can be used to create a virtual dom tree and apply patches to the real dom. It's used in `rrweb` to optimize replay performance especially wh
Latest version: 1.1.0

# rrdom

`rrdom` is a virtual dom library that is used by `rrweb` to replay DOM mutations. It is a standalone library that can be used to create a virtual dom tree and apply patches to the real dom. It's used in `rrweb` to optimize replay performance especially when seeking.
npm package: @newrelic/rrvideo
Description: transform rrweb session into video
Author: yanzhen@smartx.com
Latest version: 1.0.1

# rrvideo

rrvideo is a tool for transforming the session recorded by [rrweb](https://github.com/newrelic-forks/rrweb) into a video.

## Install rrvideo

1. Install [Node.JS](https://nodejs.org/en/download/)。
2. Run `npm i -g rrvideo` to install the rrvideo CLI.

## Use rrvideo

### Transform a rrweb session(in JSON format) into a video.

```shell
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE
```

Running this command will output a `rrvideo-output.webm` file in the current working directory.

### Config the output path

```shell
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_FILE --output OUTPUT_PATH
```

### Config the replay

You can prepare a rrvideo config file and pass it to CLI.

```shell
rrvideo --input PATH_TO_YOUR_RRWEB_EVENTS_JSON_FILE --config PATH_TO_YOUR_RRVIDEO_CONFIG_FILE
```

You can find an example of the rrvideo config file [here](./rrvideo.config.example.json).
npm package: @newrelic/rrweb-all
Description: Convenience package that includes a bundle of rrweb packages. For most new integrations, prefer `@rrweb/record` + `@rrweb/replay` first, and use `@rrweb/all` when you want a single-package setup.
Latest version: 1.1.0

# @rrweb/all

Convenience package that includes a bundle of rrweb packages.
For most new integrations, prefer `@rrweb/record` + `@rrweb/replay` first, and use `@rrweb/all` when you want a single-package setup.

| Use case                                            | Package choice                    |
| --------------------------------------------------- | --------------------------------- |
| Most new apps (explicit record/replay dependencies) | `@rrweb/record` + `@rrweb/replay` |
| Quick setup with one import                         | `@rrweb/all`                      |
| Legacy compatibility                                | `rrweb`                           |

In most production setups, recorder and replayer are deployed to different pages/apps. Use `@rrweb/record` on recorded pages and `@rrweb/replay` (or `rrweb-player`) on replay pages. Use `@rrweb/all` when you intentionally want one package for convenience (for example demos, tooling, or simplified setups).

Includes the following packages:

- [rrweb](../rrweb)
- [@rrweb/record](../record)
- [@rrweb/replay](../replay)
- [@rrweb/packer](../packer)

## Installation

### 1) Bundler / npm

```bash
npm install @rrweb/all
```

```js
import { record, Replayer, pack, unpack } from '@rrweb/all';
import '@rrweb/all/dist/style.css';
```
npm package: @newrelic/rrweb-record
Description: This package contains all the record related code in rrweb.
Latest version: 1.1.0

# @rrweb/record

This package contains all the record related code in rrweb.

## Installation

### 1) Bundler / npm (Recommended)

```bash
npm install @rrweb/record
```

```js
import { record } from '@rrweb/record';
```

### 2) Browser Without Bundler (ESM + import maps)

```html
<script type="importmap">
  {
    "imports": {
      "@rrweb/record": "https://cdn.jsdelivr.net/npm/@rrweb/record@latest/+esm"
    }
  }
</script>
<script type="module">
  import { record } from '@rrweb/record';
</script>
```

### 3) Legacy Direct `<script>` Include (UMD fallback)

Use this only for compatibility with non-module environments.

```html
<script src="https://cdn.jsdelivr.net/npm/@rrweb/record@latest/umd/record.min.js"></script>
```

The legacy UMD global is `rrwebRecord`.

## Usage

```js
import { record } from '@rrweb/record';

record({
  emit(event) {
    // send event to server
  },
});
```

## Notes

Currently this package is really just a wrapper around the `record` function in the main `rrweb` package.
All `record` related code will get moved here in the future.
npm package: @newrelic/rrweb-replay
Description: This package contains all the necessary code to replay recorded events.
Latest version: 1.1.0

# @rrweb/replay

This package contains all the necessary code to replay recorded events.

## Installation

### 1) Bundler / npm (Recommended)

```bash
npm install @rrweb/replay
```

```js
import { Replayer } from '@rrweb/replay';
import '@rrweb/replay/dist/style.css';
```

### 2) Browser Without Bundler (ESM + import maps)

```html
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/style.css"
/>
<script type="importmap">
  {
    "imports": {
      "@rrweb/replay": "https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/+esm"
    }
  }
</script>
<script type="module">
  import { Replayer } from '@rrweb/replay';
</script>
```

### 3) Legacy Direct `<script>` Include (UMD fallback)

Use this only for compatibility with non-module environments.

```html
<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/dist/style.css"
/>
<script src="https://cdn.jsdelivr.net/npm/@rrweb/replay@latest/umd/replay.min.js"></script>
```

The legacy UMD global is `rrwebReplay`.

## Usage

```js
import { Replayer } from '@rrweb/replay';
import '@rrweb/replay/dist/style.css';

const replayer = new Replayer(events, {
  // options
});
replayer.play();
```

## Notes

Currently this package is really just a wrapper around the `Replayer` class in the main `rrweb` package.
All `Replayer` related code will get moved here in the future.
npm package: @newrelic/rrweb-snapshot
Description: rrweb's component to take a snapshot of DOM, aka DOM serializer
Author: yanzhen@smartx.com
Latest version: 1.1.0

# rrweb-snapshot

Snapshot the DOM into a stateful and serializable data structure.
Also, provide the ability to rebuild the DOM via snapshot.

## API

This module export following methods:

### snapshot

`snapshot` will traverse the DOM and return a stateful and serializable data structure which can represent the current DOM **view**.

There are several things will be done during snapshot:

1. Inline some DOM states into HTML attributes, e.g, HTMLInputElement's value.
2. Turn script tags into `noscript` tags to avoid scripts being executed.
3. Try to inline stylesheets to make sure local stylesheets can be used.
4. Make relative paths in href, src, CSS to be absolute paths.
5. Give an id to each Node, and return the id node map when snapshot finished.

#### rebuild

`rebuild` will build the DOM according to the taken snapshot.

There are several things will be done during rebuild:

1. Add data-rrid attribute if the Node is an Element.
2. Create some extra DOM node like text node to place inline CSS and some states.
3. Add data-extra-child-index attribute if Node has some extra child DOM.

#### serializeNodeWithId

`serializeNodeWithId` can serialize a node into snapshot format with id.

#### buildNodeWithSN

`buildNodeWithSN` will build DOM from serialized node and store serialized information in the `mirror.getMeta(node)`.