Skip to content

Commit

Permalink
Make package ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
knutkirkhorn committed Mar 4, 2023
1 parent 875e8f7 commit 96bf456
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 475 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_style = space
indent_size = 2
56 changes: 29 additions & 27 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:ava/recommended"
],
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module"
},
"rules": {
"indent": ["error", 4],
"linebreak-style": "off",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"arrow-parens": ["error", "as-needed"],
"object-curly-spacing": ["error", "never"],
"comma-dangle": ["error", "never"],
"import/extensions": ["error", "always"],
"no-console": "off",
"max-len": "off",
"no-plusplus": "off"
}
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"airbnb-base",
"plugin:ava/recommended",
"plugin:import/recommended",
"plugin:unicorn/recommended"
],
"parserOptions": {
"ecmaVersion": 2023,
"sourceType": "module"
},
"rules": {
"indent": ["error", "tab", {"SwitchCase": 1}],
"no-tabs": "off",
"linebreak-style": "off",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"arrow-parens": ["error", "as-needed"],
"object-curly-spacing": ["error", "never"],
"comma-dangle": ["error", "never"],
"import/extensions": ["error", "always"],
"no-console": "off",
"max-len": "off",
"no-plusplus": "off"
}
}
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# Auto detect text files and perform LF normalization
* text=auto
* text=auto eol=lf
9 changes: 4 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ jobs:
strategy:
matrix:
node-version:
- 14
- 12
- 10
- 18
- 16
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
59 changes: 25 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,38 @@
## Installation

```
$ npm install --global btc-value-cli
npm install --global btc-value-cli
```

## Usage

```
$ btc-value --help
Usage
$ btc-value
Options
--key -k Set the API key (Obtain key at: https://coinmarketcap.com/api/)
--decimal -d Print value as decimal
--save -s [code] Set the currency that will be used by default
--currency -c [code] Print the value in another currency
--list -l Print a list of all supported currencies
--quantity -q [number] Print the value of the given quantity
--autorefresh -a [seconds] Automatic refresh printing every x seconds
--percentage -p [h|d|w] Print the percentage change (h = hour, d = day, w = week)
--reset -r Reset the configuration to the default
--provider [cmc|coingecko] Set the currency provider to retrieve Bitcoin values from
Examples
$ btc-value
$16258
$ btc-value -k <example-API-key>
√ API key is set
$ btc-value -d
$16258.2
$ btc-value -s NOK
Default currency set as: NOK (kr)
kr158053
$ btc-value -c NOK
kr129640
$ btc-value -q 2.2
$17273
$ btc-value -p h
-0.08%
$ btc-value --provider coingecko
√ Set coingecko as currency provider
Usage
$ btc-value
Options
--key -k Set the API key (Obtain key at: https://coinmarketcap.com/api/)
--decimal -d Print value as decimal
--save -s [code] Set the currency that will be used by default
--currency -c [code] Print the value in another currency
--list -l Print a list of all supported currencies
--quantity -q [number] Print the value of the given quantity
--autorefresh -a [seconds] Automatic refresh printing every x seconds
--percentage -p [h|d|w] Print the percentage change (h = hour, d = day, w = week)
--reset -r Reset the configuration to the default
--provider [cmc|coingecko] Set the currency provider to retrieve Bitcoin values from
Examples
$ btc-value
$ btc-value -k <example-API-key>
$ btc-value -d
$ btc-value -s NOK
$ btc-value -c NOK
$ btc-value -q 2.2
$ btc-value -p h
$ btc-value --provider coingecko
```

## Options
Expand Down
Loading

0 comments on commit 96bf456

Please sign in to comment.