open-index/open-npm huggingface dataset:
npm package: @hint/utils-debugging-protocol-common
Description: hint debugging protocol common functionality
Latest version: 4.0.9
Deprecated: @hint/connector-chrome is obsolete, please use @hint/connector-puppeteer

# Debuggin Protocol common (`@hint/utils-debugging-protocol-common`)

Shared code for connectors that uses Chrome debugging protocol.

## Installation

To install the package, you need to run:

```bash
npm install @hint/utils-debugging-protocol-common
```
npm package: @hint/utils-dom
Description: utils for DOM
Latest version: 2.2.4

# DOM utils (`@hint/utils-dom`)

Set of helpers to process DOM. Supports parsing HTML into a light-weight
implementation of a subset of DOM standards APIs.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `createHelpers`: Inject and invoke within the context of a page to generate
  global `webhint` helpers for creating DOM snapshots and resolving unique
  IDs to `Node`s.
* `createHTMLDocument`: Create an HTMLDocument object from an string.
* `findOriginalElement`: Perform a best-effort search to find an element in
the provided document which is likely the original source for the provided
element. Used to resolve element locations to the original HTML when possible.
* `getElementByUrl`: Get an HTMLElement given a URL.
* `getHTMLCodeSnippet`: Generate a Snippet code for a HTMLElement.
* `populateGlobals`: Inject DOM APIs into the provided global context.
* `traverse`: Traverse an HTMLDocument.
* `restoreReferences`: Rebuild parent and sibling references in a DOM snapshot.
npm package: @hint/utils-fs
Description: utils for filesystem
Latest version: 1.0.16

# FileSystem utils (`@hint/utils-fs`)

Set of helpers to work with the filesystem.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `cwd`: Returns the current working directory. Same as `process.cwd()`.
* `fileExtension`: Try to determine the resource's file extension.
* `fileName`: Returns the name of a file. Same as `path.basename()`.
* `isDirectory`: Check if a path is a directory and exists.
* `isFile`: Check if a path is a file and exists.
* `loadJSFile`: Loads a JavaScript file.
* `loadJSONFile`: Loads a JSON a file.
* `pathExists`: Check if a path exists.
* `readFileAsync`: Convenience wrapper for asynchronously reading file
contents.
* `readFile`: Convenience wrapper for synchronously reading file contents.
* `writeFileAsync`: Convenience wrapper for asynchronously write a file.
npm package: @hint/utils-i18n
Description: util for i18n
Latest version: 1.0.15

# I18n utils (`@hint/utils-i18n`)

Set of helpers to print to allow i18n in webhint.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `format`: Format a string given substitutions.
* `getCategoryName`: Return the localized category name.
* `getMessage`: Get the localized message.
npm package: @hint/utils-json
Description: utils for JSON
Latest version: 1.0.28

# JSON utils (`@hint/utils-json`)

Set of helpers to process JSON.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `finalConfig`: Calculate the final configuration taking into account the
  extend property.
* `parseJSON`: Parse a json string.
* `loadJSONFile`: Loads a JSON a file.
* `JSONLocationOptions`: Type representing the options for the location.
* `JSONLocationFunction`: Type representing the options for the location
  function.
* `IJSONResult`: Interface for a JSONResult.
* `ExtendableConfiguration`: Type representing a extendable configuration.
* `IParsingError`: Interface for an error parsing.
* `ISchemaValidationError`: Interface for an error validating a json.
* `SchemaValidationResult`: Type representing the result of a json validation.
* `GroupedError`: Type representing a group of errors validating a json.
* `validate`: Validate a json given a schema.
npm package: @hint/utils-network
Description: utils for network
Latest version: 1.0.27

# Network utils (`@hint/utils-network`)

Set of helpers for network.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `asPathString`: Returns the pathname of a URL, normalizing depending
on the platform.
* `getAsUri`: Receives a string and returns a valid Uris
* `getAsUris`: Receives an array of string and returns an array of valid Uris.
* `hasProtocol`: Convenience function to check if a resource uses a specific
protocol.
* `includedHeaders`: Returns a list of all the headers in `headerList`
that are in `headers` sorted alphabetically.
* `isDataURI`: Convenience function to check if a resource is a data URI.
* `isHTMLDocument`: Convenience function to check if a resource is a
HTMLDocument.
* `isHTTP`: Convenience function to check if a resource is served over HTTP.
* `isHTTPS`: Convenience function to check if a resource is served over HTTPS.
* `isLocalFile`: Convenience function to check if a resource is a local file.
* `isRegularProtocol`: Convenience function to check if a uri's protocol
is http/https if specified.
* `normalizeHeaderValue`: Remove whitespace from both ends of a header value
and lowercase it.
* `requestAsync`: Convenience wrapper for asynchronously request an URL.
* `requestJSONAsync`: Request response in the json format from an endpoint.
* `rxLocalhost`: RegExp to test if a resource points to localhost.
* `rxLocalFile`: RegExp to test if a resource is loaded from a local file.
npm package: @hint/utils-string
Description: utils for strings
Latest version: 1.0.14

# String utils (`@hint/utils-string`)

Set of helpers to process string.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Utils

* `cutString`: Cut a given string adding `…` in the middle.
  variable available with the given `options` object.
* `mergeIgnoreIncludeArrays`: Adds the items from  `includeArray` into
`originalArray` and removes the ones from `ignoreArray`.
* `normalizeIncludes`: Return if normalized `source` string includes
normalized `included` string.
* `normalizeStringByDelimiter`: Normalize String and then replace characters
with delimiter.
* `normalizeString`: Remove whitespace from both ends of a string and
lowercase it.
* `prettyPrintArray`: Returns an array pretty printed.
* `toCamelCase`: Convert '-' delimitered string to camel case name.
* `toLowerCaseArray`: Lower cases all the items of `list`.
* `toLowerCaseKeys`: Returns the same object but with all the properties
lower cased.
* `toPascalCase`: Convert '-' delimitered string to pascal case name.
npm package: @hint/utils-tests-helpers
Description: hint tests helpers
Latest version: 6.5.7

# Tests helpers (`@hint/utils-tests-helpers`)

Set of helpers to run tests in webhint

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

### Utils

* `getHintPath`: Returns the name of the hint.
npm package: @hint/utils-types
Description: Common types package
Latest version: 1.2.1

# Types utils (`@hint/utils-types`)

Set of common types used in webhint.

## Installation

This package is installed automatically when adding webhint to your project
so running the following is enough:

```bash
npm install hint --save-dev
```

## Types

* `Category`: Enum with the categories used for Hints
* `Problem`: Type representing an Issue found in a Hints.
* `ProblemLocation`: Type representing the location of a Problem.
* `Severity`: Enum with the severities of a hint.
* `HttpHeaders`: Type representing a HTTP Header.
npm package: @hint/utils-worker
Description: webhint web worker
Latest version: 1.4.17

# Web worker for webhint

The webhint web worker utility provides a bundled version of webhint
suitable for running inside a web worker in a browser environment.

## Installation

This package can be installed via npm by running the following:

```bash
npm install @hint/utils-worker --save
```

A pre-built version of the webhint web worker is included as part of this
package named `webhint.js`. You can locate the file in Node using
`require.resolve('@hint/utils-worker/webhint.js')`.

## Usage

The included `webhint.js` file is intended to be loaded via a web worker
and communicated with via `postMessage`. Information about the content to
be analyzed must be passed to the worker and the worker will return any
issues identified as a result.

```ts
const worker = new Worker('webhint.js');

worker.addEventListener('message', (event) => {
    if (event.data.requestConfig) {
        // Tell worker the URL of the page being analyzed.
        worker.postMessage({ config: { resource: 'https://example.com' } });
    } else if (event.data.ready) {
        // Once ready, forward network requests.
        worker.postMessage({ fetchStart });
        worker.postMessage({ fetchEnd });
        // Once ready, forward snapshot of the DOM (see @hint/utils-dom).
        worker.postMessage({ snapshot });
    } else if (event.data.results) {
        // Process/display results (occurs multiple times).
    } else if (event.data.error) {
        // Log/handle fatal errors reported by the worker.
    }
});
```

The worker contains a subset of hints suitable for running in a browser
environment without direct access to the page. These hints can be
disabled or configured using the same format as [.hintrc][hintrc]
files. Just pass the object as `userConfig` when sending the
configuration.

```ts
worker.postMessage({
    config: {
        resource: 'https://example.com',
        userConfig: {
            browserslist: 'defaults, not IE 11',
            hints: {
                'compat-api/css': ['error', { ignore: ['border-radius', 'box-lines'] }],
                'css-prefix-order': 'off'
            }
        }
    }
});
```

All included hints are enabled by default. To disable all included
hints and selectively enable only a few, change the default severity.

```ts
worker.postMessage({
    config: {
        defaultHintSeverity: 'off',
        userConfig: { hints: { 'button-type': 'default' } }
    }
});
```

## Contributing to the worker

To contribute to the worker please read the [`CONTRIBUTING.md`][contributing]
file of the package.

<!-- Link labels -->

[contributing]: https://github.com/webhintio/hint/blob/main/packages/utils-worker/CONTRIBUTING.md
[hintrc]: https://webhint.io/docs/user-guide/configuring-webhint/summary/