1.1.0 • Published 2 months ago

statistician v1.1.0

Weekly downloads
854
License
MIT
Repository
github
Last release
2 months ago

statistician

Create and compare files stats, and webpack bundle stats

Use webpack stats file and self created files stats file to compare between states of the package, and comment on GitHub pull requests

CLI Examples

Create webpack stats

webpack --config <CONFIG_FILE> --profile --json > stats.json

See webpack stats API for more details


files

Create file stats

npx statistician@0 files --dir "./dist" --ignore "\.map$" --ignore "(^|\/)\." --ignore "(^|/)node_modules\/," > files.json
OptionMeaningExample
dirDirectory holding the files to measure--dir "./dist"
ignorePattern to exclude from summary--ignore "\.map$"

Outputs JSON

files output example

{
  "dist/arrows.svg": 645,
  "dist/badges-sprite.svg": 948,
  "dist/index.css": 6004,
  "dist/index.js": 62304,
  "dist/outline.svg": 531,
  "dist/shields.svg": 345
}

github-pull-request

Create pull request

Example using CircleCI env variables

npx statistician@0 github-pull-request --file "./files-before.json,./files-after.json" --bundle "./stats-before.json,./stats-after.json" --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --pr $(basename $CIRCLE_PULL_REQUEST) --token $GITHUB_API_TOKEN

or with Gith App authentication

npx statistician@0 github-pull-request --file "./files-before.json,./files-after.json" --bundle "./stats-before.json,./stats-after.json" --user $CIRCLE_PROJECT_USERNAME --repo $CIRCLE_PROJECT_REPONAME --pr $(basename $CIRCLE_PULL_REQUEST) --appId $GITHUB_APP_ID --appPrivateKey $GITHUB_APP_PRIVATE_KEY
OptionMeaningExample
filepair of file stats to compare (comma separated)--file "./files-before.json,./files-after.json"
bundlepair of bundle stats to compare (comma separated)--file "./files-before.json,./files-after.json"
userRepository owner / org (* not necessarily commenter)--user fiverr
repoName of repository--repo some-package
prPull request number--pr 24
tokenGitHub API Token--token s4f5ybwne84bodafzopayrtjrc2koa2k4qb3y1wp
appIdGitHub AppID206123
appPrivateKeyGitHub App Private Key-----BEGIN RSA PRIVATE KEY----- \n ABXEogIBCDSKCAQEA1....

Two ways of authentication are available.

  • Use a personal access token - in this case you will provide the token but you don't need to provide appId and appPrivateKey.
  • Use a Github application - in this case, you will provide appId and appPrivateKey but you don't need to provide token.

Pull request comment example


diff-summary

Creates the markdown summary

npx statistician@0 diff-summary --file "./files-before.json,./files-after.json" --bundle "./stats-before.json,./stats-after.json"
OptionMeaningExample
filepair of file stats to compare (comma separated)--file "./files-before.json,./files-after.json"
bundlepair of bundle stats to compare (comma separated)--bundle "./stats-before.json,./stats-after.json"

summary

Creates a markdown summary of all the information

npx statistician@0 summary --file "./files.json" --bundle "./stats.json" [--html]
OptionMeaningExample
filefile stats--file "./files.json"
bundlebundle stats--bundle "./stats-after.json"
htmloutput in HTML--html
1.1.0

2 months ago

1.0.0

4 months ago

1.0.0-rc-e83ee23

4 months ago

1.0.0-rc-9a035bc

4 months ago

0.7.0

1 year ago

0.6.0-rc-2a030b1

2 years ago

0.6.0-rc-39bb1b9

2 years ago

0.6.0-rc-5aa8501

2 years ago

0.6.0-rc-832377c

2 years ago

0.6.0-rc-d86a570

2 years ago

0.6.0-rc-318c9c6

2 years ago

0.6.0

2 years ago

0.5.7

4 years ago

0.5.6

4 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.8-rc-d92b9a4

5 years ago

0.4.8-rc-d418a74

5 years ago

0.4.8-rc-f0318d4

5 years ago

0.4.7

5 years ago

0.4.7-alpha.1

6 years ago

0.4.7-alpha

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.0-alpha.1

6 years ago

0.1.0-alpha

6 years ago