Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dep, move to esm and require 12.20 #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"eslint-config-moxy/es6",
"eslint-config-moxy/addons/node",
"eslint-config-moxy/addons/jest"
]
],
"parserOptions": {
"sourceType": "module"
}
}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14]
node: [12, 14, 16]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ The code originally lived in [MOXY](https://github.com/moxystudio)'s GitHub but

## Installation

`$ npm install yargs-unparser`

- Install `npm install yargs-unparser`
- Add `{ "type": "module", "engines": { "node": ">=12.20" } }` to package.json

## Usage

```js
const parse = require('yargs-parser');
const unparse = require('yargs-unparser');
import parse from 'yargs-parser';
import unparse from 'yargs-unparser';

const argv = parse(['--no-boolean', '--number', '4', '--string', 'foo'], {
boolean: ['boolean'],
Expand All @@ -44,8 +44,8 @@ The second argument of `unparse` accepts an options object:
### Example with `command` options

```js
const yargs = require('yargs');
const unparse = require('yargs-unparser');
import yargs from 'yargs';
import unparse from 'yargs-unparser';

const argv = yargs
.command('my-command <positional>', 'My awesome command', (yargs) =>
Expand All @@ -72,7 +72,7 @@ If you `coerce` in weird ways, things might not work correctly.

## Tests

`$ npm test`
`$ npm test`
`$ npm test -- --watch` during development

## Supported Node.js Versions
Expand Down
12 changes: 5 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
'use strict';

const flatten = require('flat');
const camelcase = require('camelcase');
const decamelize = require('decamelize');
const isPlainObj = require('is-plain-obj');
import flatten from 'flat';
import camelcase from 'camelcase';
import decamelize from 'decamelize';
import isPlainObj from 'is-plain-obj';

function isAlias(key, alias) {
// TODO Switch to Object.values one Node.js 6 is dropped
Expand Down Expand Up @@ -163,4 +161,4 @@ function unparser(argv, options) {
return unparsed;
}

module.exports = unparser;
export default unparser;
Loading