Skip to content

Commit 5063678

Browse files
author
Shogun
committed
feat: Initial commit.
0 parents  commit 5063678

File tree

10 files changed

+4029
-0
lines changed

10 files changed

+4029
-0
lines changed

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
extends: ['standard'],
3+
rules: {
4+
/*
5+
This is inserted to make this compatible with prettier.
6+
Once https://github.com/prettier/prettier/issues/3845 and https://github.com/prettier/prettier/issues/3847 are solved this might be not needed any more.
7+
*/
8+
'space-before-function-paren': 0,
9+
curly: [2, 'all']
10+
}
11+
}

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: CI
3+
on: [push, pull_request]
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v1
10+
- name: Use Node.js LTS
11+
uses: actions/setup-node@v1
12+
with:
13+
node-version: 10.x
14+
- name: Restore cached dependencies
15+
uses: actions/cache@v1
16+
with:
17+
path: node_modules
18+
key: node-modules-${{ hashFiles('**/package-lock.json') }}
19+
- name: Install dependencies
20+
run: npm install
21+
- name: Run Tests
22+
run: npm run ci
23+
# - name: Upload coverage to Codecov
24+
# uses: codecov/codecov-action@v1
25+
# with:
26+
# file: ./coverage/coverage-final.json
27+
# token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.nyc_output
2+
coverage

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### 2020-01-14 / 0.1.0
2+
3+
- Initial version.

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Welcome to fast-jwt!
2+
3+
Please take a second to read over this before opening an issue. Providing complete information upfront will help us address any issue (and ship new features!) faster.
4+
5+
We greatly appreciate bug fixes, documentation improvements and new features, however when contributing a new major feature, it is a good idea to idea to first open an issue, to make sure the feature it fits with the goal of the project, so we don't waste your or our time.
6+
7+
## Bug Reports
8+
9+
A perfect bug report would have the following:
10+
11+
1. Summary of the issue you are experiencing.
12+
2. Details on what versions of node and XZY you are using (`node -v`).
13+
3. A simple repeatable test case for us to run. Please try to run through it 2-3 times to ensure it is completely repeatable.
14+
15+
We would like to avoid issues that require a follow up questions to identify the bug. These follow ups are difficult to do unless we have a repeatable test case.
16+
17+
## For Developers
18+
19+
All contributions should fit the [standard](https://github.com/standard/standard) linter, and pass the tests.
20+
You can test this by running:
21+
22+
```
23+
npm lint
24+
npm test
25+
```
26+
27+
## For Collaborators
28+
29+
Make sure to get a `:thumbsup:`, `+1` or `LGTM` from another collaborator before merging a PR. If you aren't sure if a release should happen, open an issue.
30+
31+
Release process:
32+
33+
- `npm test`
34+
- `npm version <major|minor|patch>`
35+
- `git push && git push --tags`
36+
- `npm publish`
37+
38+
---
39+
40+
<a id="developers-certificate-of-origin"></a>
41+
42+
## Developer's Certificate of Origin 1.1
43+
44+
By making a contribution to this project, I certify that:
45+
46+
- (a) The contribution was created in whole or in part by me and I
47+
have the right to submit it under the open source license
48+
indicated in the file; or
49+
50+
- (b) The contribution is based upon previous work that, to the best
51+
of my knowledge, is covered under an appropriate open source
52+
license and I have the right under that license to submit that
53+
work with modifications, whether created in whole or in part
54+
by me, under the same open source license (unless I am
55+
permitted to submit under a different license), as indicated
56+
in the file; or
57+
58+
- (c) The contribution was provided directly to me by some other
59+
person who certified (a), (b) or (c) and I have not modified
60+
it.
61+
62+
- (d) I understand and agree that this project and the contribution
63+
are public and that a record of the contribution (including all
64+
personal information I submit with it, including my sign-off) is
65+
maintained indefinitely and may be redistributed consistent with
66+
this project or the open source license(s) involved.

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2020 nearForm
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

package.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "fast-jwt",
3+
"version": "0.1.0",
4+
"description": "Fast JSON Web Token implementation",
5+
"author": "NearForm Ltd",
6+
"homepage": "https://github.com/nearform/fast-jwt",
7+
"contributors": [
8+
{
9+
"name": "Paolo Insogna",
10+
"url": "https://github.com/ShogunPanda"
11+
}
12+
],
13+
"license": "Apache-2.0",
14+
"licenses": [
15+
{
16+
"type": "Apache-2.0",
17+
"url": "http://www.apache.org/licenses/LICENSE-2.0"
18+
}
19+
],
20+
"keywords": [
21+
"jwt"
22+
],
23+
"repository": {
24+
"type": "git",
25+
"url": "git+https://github.com/nearform/fast-jwt.git"
26+
},
27+
"bugs": {
28+
"url": "https://github.com/nearform/fast-jwt/issues"
29+
},
30+
"main": "src/index.js",
31+
"scripts": {
32+
"test": "nyc -r html -r text ava -v test/*.spec.js",
33+
"test:watch": "ava --watch -v test/*.spec.js",
34+
"ci": "npm run lint && nyc -check-coverage --branches 90 --functions 90 --lines 90 --statements 90 -r json ava -v --no-color test/*.spec.js",
35+
"lint": "eslint src/**/*.js test/**/*.js",
36+
"prepublishOnly": "npm run ci",
37+
"postpublish": "git push origin && git push origin -f --tags"
38+
},
39+
"dependencies": {
40+
"ecdsa-sig-formatter": "^1.0.11"
41+
},
42+
"devDependencies": {
43+
"ava": "^2.4.0",
44+
"eslint": "^6.8.0",
45+
"eslint-config-standard": "^14.1.0",
46+
"eslint-plugin-import": "^2.20.0",
47+
"eslint-plugin-node": "^11.0.0",
48+
"eslint-plugin-promise": "^4.2.1",
49+
"eslint-plugin-standard": "^4.0.1",
50+
"nyc": "^15.0.0",
51+
"prettier": "^1.19.1"
52+
},
53+
"engines": {
54+
"node": ">= 10.0.0"
55+
}
56+
}

prettier.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
printWidth: 120,
3+
semi: false,
4+
singleQuote: true,
5+
bracketSpacing: true
6+
}

0 commit comments

Comments
 (0)