open-index/open-npm huggingface dataset:
npm package: @perfectum/cli
Description: Command line interface for Perfectum performance tools
Author: Zakharov Vladislav
Latest version: 1.1.1

# Perfectum CLI
The command-line interface for convenient work with Perfectum performance tools :computer:
### ![Perfectum CLI](cli.gif)

## Installation
```sh
yarn global add @perfectum/cli
```

## Usage
```sh
perfectum <command> <options>
```

## Commands
### `audit`
**Description**

Running a project performance audit using [@perfectum/synthetic](../synthetic) library

**Example**
```bash
perfectum audit --urls.main="https://www.example.com" --config="./perfectum.json"
```

**Options**
```bash
--urls, -u                              URLs whose performance you want to audit                           [object]

--config, -c                            Path to configuration file                                         [string]

--numberOfAuditRuns, -n                 Number of performance audit runs                                   [number]

--authenticationScriptPath              Path to authentication script file                                 [string]

--commandExecutionContextPath           Path to execution context directory                                [string]

--skipBuildProject                      Skip the build phase of the project                                [boolean]

--skipStartProject                      Skip the start phase of the project                                [boolean]

--buildProjectCommand                   Command to build the project                                       [string]

--startProjectCommand                   Command to start the project                                       [string]

--buildProjectTimeout                   Timeout for the project build command in minutes                   [number]

--startProjectTimeout                   Timeout for the project start command in minutes                   [number]

--buildProjectCompleteStringPattern     String pattern for listening to the end of the project build       [string]

--startProjectCompleteStringPattern     String pattern for listening to the end of the project start       [string]

--clearReportFilesDirectoryBeforeAudit  Clear the directory with report files before audit                 [boolean]

--version                               Show version number                                                [boolean]

--help                                  Show help                                                          [boolean]
```

For a more flexible configuration of launching an audit use the [Perfectum configuration file](./perfectum.json#L137).
npm package: @perfectum/synthetic
Description: Library for measuring synthetic performance metrics
Author: Zakharov Vladislav
Latest version: 1.1.1

# Perfectum Synthetic
Library for measuring synthetic performance metrics :vertical_traffic_light:

## Features
* Build and launch your project :rocket:
* Authentication before performance audit :ticket:
* Reporting for desktop and mobile devices :clipboard:
* Using performance budgets, including segregation by device type and application page :rotating_light:

## Built With
* [Chrome Launcher](https://github.com/GoogleChrome/chrome-launcher)
* [Lighthouse](https://github.com/GoogleChrome/lighthouse)
* [Puppeteer](https://github.com/puppeteer/puppeteer)

## Installation
```sh
yarn add @perfectum/synthetic -D
```

## Usage
For more convenient work with this package, we recommend using [Perfectum CLI](../cli/).

```javascript
import Perfectum from '@perfectum/synthetic';

new Perfectum({
  urls: {
    main: 'https://www.example.com/',
    profile: 'https://www.example.com/profile/',
  },
  budgets: [
    {
      'url': 'main',
      'first-contentful-paint': {
        'mobile': {
          'target': 2150,
          'current': 2650
         },
        'desktop': {
          'target': 1850,
          'current': 2350
        }
      },
      'interactive': {
        'mobile': {
          'target': 2950,
          'current': 3550
        },
        'desktop': {
          'target': 2650,
          'current': 3250
        }
      }
    }
  ],
  numberOfAuditRuns: 5,
  buildProjectTimeout: 10,
  startProjectTimeout: 10,
  buildProjectCommand: 'yarn run build',
  startProjectCommand: 'yarn run start',
  buildProjectCompleteStringPattern: 'The project was built',
  startProjectCompleteStringPattern: 'You can now view example in the browser'
});
```
npm package: @perfobyte/doperdo
Description: A language that makes your web app truly native — without kludges or workarounds.
Author: PerfoByte LLC
Latest version: 1.0.24
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# doperdo
A language that makes your web app truly native — without kludges or workarounds.


# Installation:

```bash
npm i @perfobyte/doperdo @perfobyte/strucdom
```


# HTML:

## Nested elements:

* Input:

```xml
<html>
    <paste from="./html_content.html"></paste>
</html>
```

* Output:

```xml
<html>
    <head><title>hello</title></head>
    <body><p>world</p></body>
</html>
```

## Inserting values ​​into a string:

* Input:
```xml
<html lang="${lang}">
    <put to="parentElement"/>

    <head></head>
    <body>
        <put>
            <div data-a="${mode}">
        </put>
    </body>
</html>
```


* Output:
```xml
<html lang="en">
    <head></head>
    <body>
        <div data-a="0">
    </body>
</html>
```

## Condition:

### IF:

* Input:
```xml
<html lang="en">
    <head>
        <if is_dev>
            <script src="./debug.js"></script>
        </if>
    </head>
    <body></body>
</html>
```


* Output
```xml
<html lang="en">
    <head>
        <script src="./debug.js"></script>
    </head>
    <body></body>
</html>
```


## Compress:

* Before:
```xml
<html lang="en">
    <head>
        <script src="./debug.js"></script>
    </head>
    <body></body>
</html>
```


* After:
```xml
<html lang="en"><head><script src="./debug.js"></script></head><body></body></html>
```


# Working example:
```js

import {
    parse,
    create_document,
    Node,
    UnclosedHtmlTags as unclosed,
    SpaceCharacters as space,
    QuotesCharacters as quotes,
    ResultCode,
} from '@perfobyte/strucdom';

import { html_compile, html_compress } from '@perfobyte/doperdo';
import {readFileSync, writeFileSync} from 'fs';
import {join, dirname} from 'path';



(() => {

    var
        locals = {
            mode: 0,
            lang: 'en',

            is_dev: (t) => {
                return (
                    t.mode === 0
                );
            },
        },

        file_path = "/home/user/my_html/index.html",
        cwd = dirname(file_path),

        html = readFileSync(file_path).toString(),
        document = create_document([]),

        api = {
            read: readFileSync,

            join,
            dirname,
            
            Array:Array,
            Node,
            unclosed,
            quotes,
            space,
        },

        result_code = (
            parse(
                html, document,
                0, html.length,
                unclosed, space, quotes,
                Node, Array,
            )
        )
    ;
    if (result_code === ResultCode.SUCCESS) {
        html_compile(document, cwd, locals, api, html_compile);
        html_compress(document, html_compress);
    
        writeFileSync("dist.html", document.outer_html(unclosed))
    }
    else {
        console.log(result_code)
    }
})();

```