Skip to content

Commit 408fa40

Browse files
committed
Update dependencies
1 parent 23b1583 commit 408fa40

File tree

5 files changed

+22
-29
lines changed

5 files changed

+22
-29
lines changed

lib/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
#!/usr/bin/env node
2-
import clipboardy from 'clipboardy'
2+
import {write as copyToClipboard} from 'clipboardy'
33
import cli from './cli.js'
44
import update from './update.js'
55
import input from './input.js'
66
import output from './output.js'
77

8-
const {writeSync: copyToClipboard} = clipboardy
9-
108
async function main(cli) {
119
const data = await input(cli)
1210

1311
if (typeof data === 'undefined') {
1412
return cli.showHelp(0)
1513
}
1614

17-
const result = output(cli, data)
15+
const result = await output(cli, data)
1816

1917
const {copy} = cli.flags
2018

2119
if (copy) {
22-
copyToClipboard(result)
20+
await copyToClipboard(result)
2321
console.log('copied')
2422
} else {
2523
console.log(result)

lib/input.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import path from 'node:path'
22
import process from 'node:process'
33
import getStdin from 'get-stdin'
4-
import leftPhalange from 'left-phalange-api'
4+
import {load, parse} from 'left-phalange-api'
55

6-
const {load, parse} = leftPhalange
76
const {join, isAbsolute} = path
87

98
async function input(cli) {

lib/output.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import leftPhalange from 'left-phalange-api'
1+
import {stringify} from 'left-phalange-api'
22

3-
const {stringify} = leftPhalange
4-
5-
function output(cli, data) {
3+
async function output(cli, data) {
64
const {flags} = cli
75
const {output, pretty} = flags
8-
const result = stringify(data, {
6+
const result = await stringify(data, {
97
type: output,
108
pretty,
119
})

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "left-phalange",
33
"version": "3.0.1",
4-
"description": "Convert data between CommonJS, ESModule, INI, JSON, JSON5, TOML, YAML",
4+
"description": "Convert data between YAML, TOML, JSON, JSON5, INI, CSV, ES Module, CommonJS",
55
"keywords": [
66
"convert",
77
"data",
@@ -66,14 +66,14 @@
6666
"clipboardy": "2.3.0",
6767
"esm-utils": "1.1.0",
6868
"get-stdin": "9.0.0",
69-
"left-phalange-api": "2.0.0",
69+
"left-phalange-api": "3.0.0",
7070
"meow": "10.1.1",
7171
"update-notifier": "5.1.0"
7272
},
7373
"devDependencies": {
7474
"@commitlint/cli": "13.1.0",
7575
"@fisker/commitlint-config": "1.3.6",
76-
"@fisker/eslint-config": "7.1.1",
76+
"@fisker/eslint-config": "7.1.2",
7777
"@fisker/eslint-config-ava": "2.0.2",
7878
"@fisker/husky-config": "4.1.0",
7979
"@fisker/lint-staged-config": "3.1.0",
@@ -85,7 +85,7 @@
8585
"eslint": "7.32.0",
8686
"execa": "5.1.1",
8787
"husky": "7.0.1",
88-
"lint-staged": "11.1.1",
88+
"lint-staged": "11.1.2",
8989
"markdownlint-cli": "0.28.1",
9090
"npm-run-all": "4.1.5",
9191
"prettier": "2.3.2",

readme.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# left-phalange
22

3-
> Convert data between CommonJS, ESModule, INI, JSON, JSON5, TOML, YAML
3+
> Convert data between YAML, TOML, JSON, JSON5, INI, CSV, ES Module, CommonJS
44
55
## Quick Overview
66

@@ -40,29 +40,27 @@ lp --help
4040

4141
### input
4242

43-
- cjs (CommonJS, file only, not stdin)
44-
- esm (ESModule, file only, not stdin)
43+
- yaml (default value for Stdin, `YAML` is superset of `JSON`, so it should work for `JSON` as well)
44+
- json
4545
- ini
4646
- js (CommonJS or ESModule, file only, not stdin)
47-
- json
4847
- json5
4948
- toml
50-
- yaml (default value for Stdin, `YAML` is superset of `JSON`, so it should work for `JSON` as well)
49+
- csv
50+
- esm (ESModule, file only, not stdin)
51+
- cjs (CommonJS, file only, not stdin)
5152

5253
### output
5354

54-
- cjs
55-
- esm
56-
- ini
5755
- json (default)
56+
- yaml
57+
- ini
5858
- json5
5959
- toml
60-
- yaml
60+
- csv
61+
- cjs
62+
- esm
6163

6264
## Related
6365

6466
- [left-phalange-api](https://github.com/fisker/left-phalange-api) - API for this module
65-
66-
## License
67-
68-
MIT © [fisker Cheung](https://github.com/fisker)

0 commit comments

Comments
 (0)