Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
f251a7d0fa | |||
cfdf0267e9 | |||
0c5a88a08f | |||
261f86d664 | |||
b0116a7967 | |||
6dfdfd41b9 | |||
2e9bc0db42 | |||
af837f5303 | |||
9145cc890c | |||
e3fa407c1c | |||
865e58b190 | |||
66d00d938c | |||
5c3e165625 | |||
82e282a19f | |||
16ca87923d | |||
62676cf816 |
22
.gitignore
vendored
22
.gitignore
vendored
@ -1,4 +1,20 @@
|
|||||||
node_modules/
|
.nogit/
|
||||||
pages/
|
|
||||||
public/
|
# artifacts
|
||||||
coverage/
|
coverage/
|
||||||
|
public/
|
||||||
|
pages/
|
||||||
|
|
||||||
|
# installs
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# caches
|
||||||
|
.yarn/
|
||||||
|
.cache/
|
||||||
|
.rpt2_cache
|
||||||
|
|
||||||
|
# builds
|
||||||
|
dist/
|
||||||
|
dist_*/
|
||||||
|
|
||||||
|
# custom
|
150
.gitlab-ci.yml
150
.gitlab-ci.yml
@ -1,16 +1,19 @@
|
|||||||
# gitzone standard
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm install -g @shipzone/npmci
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@ -18,109 +21,114 @@ stages:
|
|||||||
mirror:
|
mirror:
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g snyk
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm install --production --ignore-scripts
|
||||||
- npmci command snyk test
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
allow_failure: true
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
# ====================
|
# ====================
|
||||||
testLEGACY:
|
|
||||||
stage: test
|
|
||||||
script:
|
|
||||||
- npmci node install legacy
|
|
||||||
- npmci npm install
|
|
||||||
- npmci npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- docker
|
|
||||||
- notpriv
|
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
testLTS:
|
testStable:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install lts
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci npm test
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
testSTABLE:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci node install stable
|
||||||
- npmci npm test
|
- npmci npm install
|
||||||
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install stable
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# metadata stage
|
# metadata stage
|
||||||
# ====================
|
# ====================
|
||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
image: docker:stable
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
services:
|
only:
|
||||||
- docker:stable-dind
|
- tags
|
||||||
script:
|
script:
|
||||||
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
|
- npmci command npm install -g typescript
|
||||||
- docker run
|
- npmci npm prepare
|
||||||
--env SOURCE_CODE="$PWD"
|
- npmci npm install
|
||||||
--volume "$PWD":/code
|
|
||||||
--volume /var/run/docker.sock:/var/run/docker.sock
|
|
||||||
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
|
|
||||||
artifacts:
|
|
||||||
paths: [codeclimate.json]
|
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- priv
|
- docker
|
||||||
|
- priv
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci trigger
|
- npmci trigger
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- lossless
|
||||||
- notpriv
|
- docker
|
||||||
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g typedoc typescript
|
- npmci node install lts
|
||||||
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
@ -128,15 +136,5 @@ pages:
|
|||||||
artifacts:
|
artifacts:
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
allow_failure: true
|
|
||||||
|
|
||||||
windowsCompatibility:
|
|
||||||
image: stefanscherer/node-windows:10-build-tools
|
|
||||||
stage: metadata
|
|
||||||
script:
|
|
||||||
- npm install & npm test
|
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
|
||||||
tags:
|
|
||||||
- windows
|
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
11
.vscode/launch.json
vendored
Normal file
11
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"command": "npm test",
|
||||||
|
"name": "Run npm test",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "node-terminal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
28
README.md
28
README.md
@ -1,28 +0,0 @@
|
|||||||
# early
|
|
||||||
|
|
||||||
minimal and fast loading plugin for startup time measuring
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://GitLab.com/pushrocks/early)
|
|
||||||
[](https://github.com/pushrocks/early)
|
|
||||||
[](https://pushrocks.gitlab.io/early/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://david-dm.org/pushrocks/early)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -1,44 +0,0 @@
|
|||||||
# early
|
|
||||||
|
|
||||||
minimal and fast loading plugin for startup time measuring
|
|
||||||
|
|
||||||
## Availabililty
|
|
||||||
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://GitLab.com/pushrocks/early)
|
|
||||||
[](https://github.com/pushrocks/early)
|
|
||||||
[](https://pushrocks.gitlab.io/early/)
|
|
||||||
|
|
||||||
## Status for master
|
|
||||||
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://GitLab.com/pushrocks/early/commits/master)
|
|
||||||
[](https://www.npmjs.com/package/early)
|
|
||||||
[](https://david-dm.org/pushrocks/early)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early/master/dependencies/npm)
|
|
||||||
[](https://www.bithound.io/github/pushrocks/early)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](http://standardjs.com/)
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
Use TypeScript for best in class instellisense.
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
// Put the following at the start of your module
|
|
||||||
import * as early from 'early';
|
|
||||||
early.start('myModuleName');
|
|
||||||
/*
|
|
||||||
do your loading stuff
|
|
||||||
*/
|
|
||||||
early.stop().then((loadingTime: number) => {
|
|
||||||
// loadingTime in milliseconds
|
|
||||||
}); // stop "early" when your module is ready
|
|
||||||
```
|
|
||||||
|
|
||||||
For further information read the linked docs at the top of this README.
|
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
|
||||||
|
|
||||||
[](https://push.rocks)
|
|
@ -1,11 +1,17 @@
|
|||||||
{
|
{
|
||||||
"npmts":{
|
"npmci": {
|
||||||
"coverageTreshold":50
|
"npmGlobalTools": [],
|
||||||
},
|
"npmAccessLevel": "public"
|
||||||
"npmci": {
|
},
|
||||||
"npmGlobalTools": [
|
"gitzone": {
|
||||||
"@gitzone/npmts"
|
"projectType": "npm",
|
||||||
],
|
"module": {
|
||||||
"npmAccessLevel": "public"
|
"githost": "gitlab.com",
|
||||||
|
"gitscope": "pushrocks",
|
||||||
|
"gitrepo": "early",
|
||||||
|
"description": "minimal and fast loading plugin for startup time measuring",
|
||||||
|
"npmPackagename": "@pushrocks/early",
|
||||||
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
10250
package-lock.json
generated
10250
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/early",
|
"name": "@pushrocks/early",
|
||||||
"version": "3.0.2",
|
"version": "4.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "minimal and fast loading plugin for startup time measuring",
|
"description": "minimal and fast loading plugin for startup time measuring",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tsrun test/test.ts)",
|
"test": "(tstest test/)",
|
||||||
"build": "(npmts)"
|
"build": "(tsbuild --web)"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -23,12 +24,29 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/pushrocks/early#readme",
|
"homepage": "https://gitlab.com/pushrocks/early#readme",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsrun": "^1.1.9",
|
"@gitzone/tsbuild": "^2.1.63",
|
||||||
"@pushrocks/smartdelay": "^2.0.1",
|
"@gitzone/tsrun": "^1.2.35",
|
||||||
"@pushrocks/tapbundle": "^3.0.1"
|
"@gitzone/tstest": "^1.0.71",
|
||||||
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
|
"@pushrocks/tapbundle": "^5.0.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/consolecolor": "^2.0.1",
|
"@pushrocks/consolecolor": "^2.0.1",
|
||||||
"@pushrocks/smartpromise": "^2.0.5"
|
"@pushrocks/smartpromise": "^3.1.7"
|
||||||
}
|
},
|
||||||
|
"files": [
|
||||||
|
"ts/**/*",
|
||||||
|
"ts_web/**/*",
|
||||||
|
"dist/**/*",
|
||||||
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
|
"dist_ts_web/**/*",
|
||||||
|
"assets/**/*",
|
||||||
|
"cli.js",
|
||||||
|
"npmextra.json",
|
||||||
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
51
readme.md
Normal file
51
readme.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
# @pushrocks/early
|
||||||
|
minimal and fast loading plugin for startup time measuring
|
||||||
|
|
||||||
|
## Availabililty and Links
|
||||||
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/early)
|
||||||
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/early)
|
||||||
|
* [github.com (source mirror)](https://github.com/pushrocks/early)
|
||||||
|
* [docs (typedoc)](https://pushrocks.gitlab.io/early/)
|
||||||
|
|
||||||
|
## Status for master
|
||||||
|
|
||||||
|
Status Category | Status Badge
|
||||||
|
-- | --
|
||||||
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
|
npm | [](https://lossless.cloud)
|
||||||
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Use TypeScript for best in class instellisense.
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
// Put the following at the start of your module
|
||||||
|
import * as early from 'early';
|
||||||
|
early.start('myModuleName');
|
||||||
|
/*
|
||||||
|
do your loading stuff
|
||||||
|
*/
|
||||||
|
early.stop().then((loadingTime: number) => {
|
||||||
|
// loadingTime in milliseconds
|
||||||
|
}); // stop "early" when your module is ready
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||||
|
|
||||||
|
[](https://maintainedby.lossless.com)
|
@ -1,8 +1,10 @@
|
|||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import early = require('../ts/index');
|
|
||||||
|
import * as early from '../ts/index.js';
|
||||||
|
|
||||||
tap.test('.start()', async () => {
|
tap.test('.start()', async () => {
|
||||||
|
process.env.CLI_CALL_MODULENAME = 'early';
|
||||||
early.start('early');
|
early.start('early');
|
||||||
await smartdelay.delayFor(2000);
|
await smartdelay.delayFor(2000);
|
||||||
});
|
});
|
||||||
@ -17,7 +19,7 @@ tap.test('hrTime Measurement', async () => {
|
|||||||
await smartdelay.delayFor(1000);
|
await smartdelay.delayFor(1000);
|
||||||
let measuredTime = earlyHr.stop();
|
let measuredTime = earlyHr.stop();
|
||||||
console.log(measuredTime);
|
console.log(measuredTime);
|
||||||
return expect(measuredTime.milliSeconds).to.be.greaterThan(999);
|
return expect(measuredTime.milliSeconds).toBeGreaterThan(999);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
8
ts/00_commitinfo_data.ts
Normal file
8
ts/00_commitinfo_data.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* autocreated commitinfo by @pushrocks/commitinfo
|
||||||
|
*/
|
||||||
|
export const commitinfo = {
|
||||||
|
name: '@pushrocks/early',
|
||||||
|
version: '4.0.3',
|
||||||
|
description: 'minimal and fast loading plugin for startup time measuring'
|
||||||
|
}
|
@ -6,8 +6,8 @@ import * as process from 'process';
|
|||||||
export class HrtMeasurement {
|
export class HrtMeasurement {
|
||||||
nanoSeconds: number = null;
|
nanoSeconds: number = null;
|
||||||
milliSeconds: number = null;
|
milliSeconds: number = null;
|
||||||
private _hrTimeStart = null;
|
private _hrTimeStart: [number, number] = null;
|
||||||
private _hrTimeStopDiff = null;
|
private _hrTimeStopDiff: [number, number] = null;
|
||||||
private _started: boolean = false;
|
private _started: boolean = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
18
ts/index.ts
18
ts/index.ts
@ -1,6 +1,6 @@
|
|||||||
import * as consolecolor from '@pushrocks/consolecolor';
|
import * as consolecolor from '@pushrocks/consolecolor';
|
||||||
import * as smartpromise from '@pushrocks/smartpromise';
|
import * as smartpromise from '@pushrocks/smartpromise';
|
||||||
import { HrtMeasurement } from './early.hrtMeasurement';
|
import { HrtMeasurement } from './early.hrtMeasurement.js';
|
||||||
|
|
||||||
export { HrtMeasurement };
|
export { HrtMeasurement };
|
||||||
|
|
||||||
@ -15,11 +15,11 @@ if (process.argv.indexOf('-v') === -1) {
|
|||||||
/**
|
/**
|
||||||
* start the loading
|
* start the loading
|
||||||
*/
|
*/
|
||||||
export let start = function(moduleNameArg: string = '', loaderLengthArg: string = '10') {
|
export let start = function (moduleNameArg: string = '', loaderLengthArg: string = '10') {
|
||||||
moduleName = moduleNameArg;
|
moduleName = moduleNameArg;
|
||||||
startHrt = new HrtMeasurement();
|
startHrt = new HrtMeasurement();
|
||||||
startHrt.start();
|
startHrt.start();
|
||||||
if (doText) {
|
if (doText && process.env.CLI_CALL_MODULENAME === moduleName) {
|
||||||
console.log(`**** starting ${consolecolor.coloredString(moduleNameArg, 'green')} ****`);
|
console.log(`**** starting ${consolecolor.coloredString(moduleNameArg, 'green')} ****`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -28,9 +28,15 @@ export let stop = (): Promise<number> => {
|
|||||||
let done = smartpromise.defer<number>();
|
let done = smartpromise.defer<number>();
|
||||||
let earlyExecutionTime = startHrt.stop().milliSeconds;
|
let earlyExecutionTime = startHrt.stop().milliSeconds;
|
||||||
let earlyExecutionTimeString: string = (earlyExecutionTime / 1000).toString();
|
let earlyExecutionTimeString: string = (earlyExecutionTime / 1000).toString();
|
||||||
console.log(
|
if (doText && process.env.CLI_CALL_MODULENAME === moduleName) {
|
||||||
`OK! -> finished loading within ${consolecolor.coloredString(earlyExecutionTimeString, 'blue')}`
|
console.log(
|
||||||
);
|
`OK! -> finished loading within ${consolecolor.coloredString(
|
||||||
|
earlyExecutionTimeString,
|
||||||
|
'blue'
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
done.resolve(earlyExecutionTime);
|
done.resolve(earlyExecutionTime);
|
||||||
return done.promise;
|
return done.promise;
|
||||||
};
|
};
|
||||||
|
7
tsconfig.json
Normal file
7
tsconfig.json
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": "tslint-config-standard"
|
|
||||||
}
|
|
Reference in New Issue
Block a user