Skip to content

Commit

Permalink
Add size & coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
drwpow committed Jan 20, 2020
1 parent 9166d24 commit ab3ea83
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflow/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- run: npm install
- run: npm run test:cov
- run: npm run test
- run: npx codecov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__test__/example.min.graphql
coverage
node_modules
pkg
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![version (scoped)](https://img.shields.io/npm/v/gqlmin.svg)](https://www.npmjs.com/package/gqlmin)
[![minzip](https://badgen.net/bundlephobia/minzip/gqlmin)](https://bundlephobia.com/gqlmin)
[![codecov](https://codecov.io/gh/dangodev/gqlmin/branch/master/graph/badge.svg)](https://codecov.io/gh/dangodev/gqlmin)

# 🗜 gqlmin

4 kB (gzip) GraphQL query minifier.
`< 1 kB` GraphQL query minifier (`3.4 kB` (gzip) if you include its only dependency, [Moo][moo]).

This library removes all insignificant whitespace within a GraphQL query, as well as comments.

The actual library itself is `843 bytes`; the `4 kB` includes [Moo][moo], the lexer it uses.

###

## Usage

### ES Modules
Expand Down Expand Up @@ -37,6 +37,9 @@ console.log(minified);
// query allProducts{products{name price …
```

_Note: for Node.js < 13.3.0 or if ES Modules aren’t supported, use
`const gqlmin = require('gqlmin')` instead._

### CLI

```
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gqlmin",
"version": "0.0.1",
"description": "4 kB (gzip) GraphQL query minifier",
"description": "< 1 kB GraphQL query minifier",
"repository": {
"type": "git",
"url": "git+https://github.com/dangodev/gqlmin.git"
Expand Down Expand Up @@ -34,6 +34,7 @@
"publish": "pika publish",
"pretest": "npm run build && ./pkg/bin/cli.js ./__test__/example.graphql -o ./__test__/example.min.graphql",
"test": "jest",
"test:coverage": "jest --coverage",
"version": "npm run build"
},
"@pika/pack": {
Expand Down

0 comments on commit ab3ea83

Please sign in to comment.