Skip to content

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tmountjr committed Feb 12, 2024
1 parent 397f1e8 commit 21de074
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# js-ectoken
> _JavaScript implementation of Edgio token (`ectoken`)
## Table of Contents

- [Background](#background)
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#license)

## Background

JavaScript implementation of the "Edgio Token" (`ectoken`) - see main repo [ectoken](https://github.com/edgio/ectoken) for mroe details.

## Install

1. Clone this repo.
2. `cd` into the repo directory
3. Run `npm install`

## Usage

This library is provided in CommonJS (CJS) format. To include the library in a script, `require` it:
```js
const { ECToken, encrypt, decrypt } = require('./ECToken.js')

const ec_token = new ECToken()
ec_token.addValue('ec_country_allow', 'US')
// Add additional directives in the same way.

const token = encrypt('my-secret-key', ec_token)
const plaintext = decrypt('my-secret-key', token)
```

## Contribute

We welcome issues, questions, and pull requests.

## License

This project is licensed under the terms of the Apache 2.0 open source license. Please refer to the `License-2.0.txt` file for the full terms.

0 comments on commit 21de074

Please sign in to comment.