open-index/open-npm huggingface dataset:
npm package: @such-code/html-parser-utils
Description: Utils to help parsed DOM rendering and more.
Author: Erik Podrez
Latest version: 2.0.0

### @such-code/html-parser-utils

#### Installation

```bash
npm i -D @such-code/html-parser-utils
```

Generic utils to simplify work with [htmlparser2](https://github.com/fb55/htmlparser2) library.

#### HtmlNode
Contains definitions for html elements.

#### DomRenderer
```typescript
import { Node } from 'htmlparser2';

export declare type DomRendererOptions = {};

/**
 * Helps rendering HTML AST.
 */
export declare class DomRenderer {
    /**
     * Wraps the attribute in single or double quotes.
     * @param $value
     * @static
     */
    static quote($value: string): string;
    
    constructor(options?: DomRendererOptions);

    /**
     * Completely render one element including children.
     * @param $node
     */
    renderNode($node: Node): string;

    /**
     * Renders array of elements.
     * @param $elements
     */
    renderNodes($elements: Array<Node>): string;
}
```

#### Helper methods

```TypeScript
import { ParserOptions } from 'htmlparser2/lib';
import { DataNode, DomHandlerOptions, Element, Node, NodeWithChildren } from 'domhandler/lib';
import { ProcessingInstruction } from 'domhandler/lib/node';

/**
 * Escapes special chars and converts string to RegExp matching that string.
 * @param $string
 * @returns RegExp
 */
export declare function stringToRegExp($string: string): RegExp;

/**
 * Type guard to check if $value is Node.
 * @param $value
 * @returns boolean
 */
export declare function isNode($value: any): $value is Node;

/**
 * Type guard to check if $value is DataNode.
 * @param $value
 * @returns boolean
 */
export declare function isDataNode($value: any): $value is DataNode;

/**
 * Type guard to check if $value is ProcessingInstruction.
 * @param $value
 * @returns boolean
 */
export declare function isProcessingInstruction($value: any): $value is ProcessingInstruction;

/**
 * Type guard to check if $value is NodeWithChildren.
 * @param $value
 * @returns boolean
 */
export declare function isNodeWithChildren($value: any): $value is NodeWithChildren;

/**
 * Type guard to check if $value is Element.
 * @param $value
 * @returns boolean
 */
export declare function isElement($value: any): $value is Element;

/**
 * Converts string to Array of Nodes using domhandler library.
 * @param $data
 * @param $parserOptions optional ParserOptions. Default values for `lowerCaseTags` and `lowerCaseAttributeNames` are
 * set to false.
 * @param $domHandlerOptions optional DomHandlerOptions. Override default values for DomHandler, could be used for html
 * optimization.
 * @returns Promise<Array<Node>>
 */
export declare function stringToDom($data: string, $parserOptions?: ParserOptions, $domHandlerOptions?: DomHandlerOptions): Promise<Array<Node>>;
```
npm package: @such-code/ngx-form-validation
Description: Template-driven form validation for Angular.
Author: Erik Podrez
Latest version: 20.2.0

# Template-driven form validation for Angular

## Description

This library is aimed to add reactive form validation for a template-driven form. It allows invoking action only for valid form, skipping manual validation. Validation rules could be changed on the fly by accessing `ValidationService` methods.

## Main concept

### Errors

There are two types of errors:
- control error (produced by `AbstractControl` validation pipeline);
- form error (non-validation error that relates on form action and is stored in `ErrorCollection` @see `ErrorObservingService`).

### Context

Validation context defines rules for a set of fields. You can think of a form as a set of contexts. Each form provides several contexts for different purposes for "Check" and "Validation item" directives:
- Local context (disposable context for every form that can be populated with errors);
- Named context (widely used context that has a name and can be populated from outside using `ValidationService` API).

There also exists an additional context that is used for semantic validation (When you need to check several fields of a FormGroup at once).

## Usage

Take a look at examples in `playground/ngx-form-validation`.

## Building

To build the library, run:

```bash
ng build ngx-form-validation
```

This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
npm package: @such-code/svg-sprite
Description: Tool to merge multiple svg images into one sprite.
Author: Erik Podrez
Latest version: 1.1.0

# About

This tool helps to generate sprite for svg-images. It can consume JSON configuration file with a list of svg images or
file list found by glob.

# Usage

## Using configuration file

Content of *config.json*:
```json
[
  "image-1.svg",
  "subdir/image-2.svg"
]
```

```shell
svg-sprite --config config.json --output sprite.svg --prefix "px-"
```

## Glob configuration

```shell
svg-sprite --source "./assets/**/*.svg" --output sprite.svg
```

# Known issues

- symbol id is generated from file name and could be repeated by another file with same name but in another directory;
- result should be properly formatted.
npm package: @such-n-such/stores
Description: Code for working with svelte-4 stores.
Author: Taylor Hadden
Latest version: 0.1.2

# S&S Stores

A collection of complex, Svelte-4-compatible stores that allow for the creation of nested store stuctures that ease the process of converting to & from raw json.

Includes support for sending & receiving patch updates of values and an undo stack implementation.
npm package: @such-n-such/tangent-html-to-markdown
Description: A utility for converting html (especially pasted markdown) to markdown suitable for consumption by Tangent.
Author: Taylor Hadden
Latest version: 0.1.1

# Tangent's HTML to Markdown
This package converts an HTML string to the specific needs and desires of [Tangent's](https://www.tangentnotes.com) flavor of markdown. This is currently used as the converter when copy/pasting text from the web or other rich text sources that provide `text/html` data when copied.

The current implementation wraps [Turndown](https://github.com/mixmark-io/turndown) with many custom rules and pre/post-processing to get the desired result.

## Design Goals
The overarching goal is that when you copy/paste text from the web or other source, pasting it into Tangent should result in something as close as possible to the source given the restrictions of Markdown.

This includes basics like **bold** and _italic_ text or links, but this package also makes some attempts to make apparent line spacing match in a reasonable fashion. How this is achieved will be heavily dependent on the source.

## Bug Reports
Is Tangent not handling a copy/paste in the way you expect? Open an issue describing the problem!

The most helpful bug reports will have the source html in the clipboard. When you paste a clipboard containing `text/html` data into Tangent, Tangent prints out the content of that data to the window's developer console (open with `Ctrl+Shift-i` or `Cmd+Opt+i`). Including this in a bug report along with the output you're seeing and the output you expect will help a lot when fixing problems.

## Contributing & Bug Reports
This package is published so that enterprising Tangent users can provide new test cases and new updates to those test cases. See the `tests/` and `tests/compare-files.test.ts` for existing tests.

The source `text/html` data logged to the Tangent developer console can be used as the source for a test (e.g. `my-pasted-problem.html`). An accompanying `.md` file (`my-pasted-problem.md`) is then used as the expected output that the actual parser will be compared against. A small update to `compare-files.test.ts` (which should be essentially self-explanatory given the existing examples) adds the input/output pair to the test suite.

The ideal pull request includes both the input and expected output files as well as any necessary updates to the parsing system that solve the parsing problem.

Pull requests that just add input/output pairs are also great! Those branches can be used as the basis for PRs that include the solution to whatever problem exists.
npm package: @suchangv/route-interceptor
Description: A front-end generic route interceptor
Author: suchangv
Latest version: 0.0.9
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

<h1 align="center">Route Interceptor</h1>

## Introduction

This package can intercept front-end route jumps, Does not depend on any framework, So you can use it in React, Vue, etc.
for example, intercept jump `https://wwww.google.com/` to `https://www.youtube.com`

## Online Demo

todo

## How to use

### 1. Installation

```shell
  npm i @suchangv/route-interceptor --save
```

### 2. Add this code where you like

```javascript
import { create } from "@suchangv/route-interceptor";

const interceptor = create({
  way: ["a", "window.open", "history", "hash", "location"],
  intercept: (path) => {
    return path.replace("google.com", "youtube.com");
  },
});

interceptor.start();
```

## API

| Parameter | Description             | Type                                                          | Default     |
| --------- | ----------------------- | ------------------------------------------------------------- | ----------- |
| way       | Way to be intercepted   | ('a' \| 'window.open' \| 'history' \| 'hash' \| 'location')[] | []          |
| intercept | intercept rule callback | () => string \| false                                         | () => false |

### way

#### a

Intercept Anchor tag jump, if Anchor tag has click event and called preventDefault, Will not be intercepted.

#### window.open

Intercept window.open

#### history

Will both intercept history.pushState and history.replaceState

#### hash

Intercept hash change, such as `location.hash = '#some'`

#### location

Because the origin location object can't be override, if you want to intercept `set location.href` and `location.replace`, You need to use Babel at the same time.

```javascript
// .babelrc.js
module.exports = {
  plugins: ["@suchangv/route-interceptor/plugins/babel"],
};
```

How it works

```javascript
location.href = "https://www.google.com";
location.replace("https://www.google.com");
// will transform to
$location.href = "https://www.google.com";
$location.replace("https://www.google.com");
```

It will register a object \$location into window, and transform all your code location.href to \$location.href location.replace to \$location.replace, only support intercept location.href and location.replace, don't transform other location property.

> Can't support esbuild-loader, because esbuild transform api does't support plugin.

### intercept

return a new path to jump, or return `false` to stop jump
npm package: @suchipi/ase-parser
Description: Parser for Aseprite files
Author: cyberronin
Latest version: 0.0.10

# @suchipi/ase-parser

Parse Aseprite files with Node.js, no external dependencies.

This is a fork of [ase-parser](http://npm.im/ase-parser). It was created because `ase-parser` was published to npm with its `.git` folder included, which causes npm to print an error at installation time.
s
npm package: @suchipi/babel-highlight
Description: Fork of @babel/highlight which takes style functions instead of using chalk
Author: Lily Skye
Latest version: 7.22.6

# `@suchipi/babel-highlight`

Fork of [`@babel/highlight`](https://babeljs.io/docs/babel-highlight) which uses user-provided string styling/colorization functions instead of [`chalk`](https://www.npmjs.com/package/chalk).
npm package: @suchipi/babel-highlight-kleur
Description: Fork of @babel/highlight which uses kleur instead of chalk
Author: Lily Skye
Latest version: 7.22.6

# `@suchipi/babel-highlight-kleur`

Fork of [`@babel/highlight`](https://babeljs.io/docs/babel-highlight) which uses [`kleur`](https://www.npmjs.com/package/kleur) instead of [`chalk`](https://www.npmjs.com/package/chalk).
npm package: @suchipi/babel-plugin-syntax-v8intrinsic
Description: Babel plugin which enables syntax parsing support for V8 intrinsics
Author: Lily Skye
Latest version: 7.22.4

# `@suchipi/babel-plugin-syntax-v8intrinsic`

This babel plugin enables syntax parsing support for V8 intrinsics, also known
as V8 runtime functions. See [Babel
7.6.0: V8 intrinsic runtime functions
parsing](https://babeljs.io/blog/2019/09/05/7.6.0#v8-intrinsic-runtime-functions-parsing-10148)
for more info.

This plugin does not perform any transformation; it only allows babel to parse
the syntax.

Remember that this syntax is invalid in production builds of Chrome/Chromium,
all non-V8 browsers, and Node.js without the `--allow-natives-syntax` flag. As
such, code using this syntax should not be pushed to production, and should only
be used for debugging and profiling purposes.

This plugin requires Babel 7.6.0 or higher in order to function.

## License

MIT
npm package: @suchipi/bugsnag-plugin-window-onerror
Description: @bugsnag/js plugin to report unhandled exceptions in browsers
Author: Bugsnag
Latest version: 5.0.1

# @bugsnag/plugin-window-onerror

This plugin hooks in to the browser's global `onerror` callback to provide unhandled exception reporting. It is included in the browser notifier.

## License
MIT
npm package: @suchipi/bugsnag-plugin-window-unhandled-rejection
Description: @bugsnag/js plugin to report unhandled promise rejections in browsers
Author: Bugsnag
Latest version: 5.0.3

# @bugsnag/plugin-window-unhandled-rejection

This plugin hooks in to the browser's global `unhandledRejection`/`onunhandledrejection` callbacks to provide unhandled exception reporting for Promises. It is included in the browser notifier.

## License
MIT
npm package: @suchipi/cli-toolkit
Description: CLI app creation helpers
Author: Lily Skye
Latest version: 1.0.0

# `@suchipi/cli-toolkit`

Collection of utilities which assist in writing a CLI app

- `runMain` from [`@suchipi/run-main`](https://npm.im/@suchipi/run-main)
- everything from [`@suchipi/string-utils`](https://npm.im/@suchipi/string-utils)
- `Hint` and `parseArgv` from [`clef-parse`](https://npm.im/clef-parse)
- `Path` from [`nice-path`](https://npm.im/nice-path)
- everything from [`pheno`](https://npm.im/pheno) as a namespace object `t`
npm package: @suchipi/cypress-plugin-snapshots
Description: Cypress snapshot functionality for data
Author: Meinaart van Straalen
Latest version: 1.4.5

# `@suchipi/cypress-plugin-snapshots`

> Plugin for snapshot tests in [Cypress.io](https://www.cypress.io/).

Fork of <https://github.com/meinaart/cypress-plugin-snapshots> with the following changes:

- Its latest commits published to npm (notably, a change to the peerDependencies that makes it more broadly-compatible with Cypress versions).
- The TypeScript types are changed to be compatible across Cypress versions.

## Development Notes

- You have to `npm install` in both the root dir and the `cypress` dir.
- You have to `npm start` in one terminal and `npm test` in another.
npm package: @suchipi/defer
Description: Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.
Author: Lily Scott
Latest version: 1.0.0

# @suchipi/defer

Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.

## Usage

```ts
import Defer from "@suchipi/defer";

function spinToWin(): Promise<string> {
  const defer = new Defer<string>();

  if (Date.now() % 2 === 0) {
    defer.resolve("You did it!");
  } else {
    defer.reject(new Error("Oh no!"));
  }

  return defer.promise;
}
```

## License

MIT
npm package: @suchipi/error-utils
Description: utils for parsing error stacks, apply source maps to errors, etc
Author: Lily Skye
Latest version: 0.2.1

# `@suchipi/error-utils`

Node.js utils for parsing error stacks, applying source maps to error stacks, etc

- `ParsedError` class
  - can be constructed from an Error instance
  - stack lines are parsed into a data structure with filename/line/column info
  - can be manipulated and then converted back into a normal Error
  - has a `stack` property getter which makes a V8-style stack string from the parsed stack frames
- `applySourceMapsToParsedError` function
  - updates the line/column numbers on the stack frames of a ParsedError by using source maps
  - returns a new ParsedError
- `applySourceMapsToStackFrame` function
  - same as above but for a single StackFrame
- `getStackFrame` function
  - given a stack offset number, gets a `StackFrame` instance from the current callstack.
  - offset of `0` gives the call to `getStackFrame`.
  - can be used to obtain the file name and (sometimes) function name of the currently-executing file, or one of its callers.
- `isError` function
  - type predicate function
  - returns true for objects with shape `{ name: string, message: string }` when `name` ends with "Error"