Skip to content

Commit

Permalink
refactor: use mri instead of meow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed May 2, 2023
1 parent acf1db7 commit 808316c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions bin/microlink
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env node

const cli = require('../src/cli')

if (cli.input.length === 0) cli.showHelp()
require('../src/api')(cli)
else require('../src/api')(cli)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"clipboardy": "~2.3.0",
"jsome": "~2.5.0",
"localhost-url-regex": "~1.0.7",
"meow": "~9.0.0",
"mri": "~1.2.0",
"nanospinner": "~1.1.0",
"picocolors": "~1.0.0",
"pretty-bytes": "~5.6.0",
Expand Down
14 changes: 8 additions & 6 deletions src/cli.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'use strict'

const meow = require('meow')
const mri = require('mri')

const cli = meow({
description: false,
help: require('./help'),
flags: {
const { _, ...flags } = mri(process.argv.slice(2), {
default: {
apiKey: {
default: process.env.MICROLINK_API_KEY
},
Expand All @@ -24,4 +22,8 @@ const cli = meow({
}
})

module.exports = cli
module.exports = {
flags,
input: _,
showHelp: () => console.log(require('./help'))
}

0 comments on commit 808316c

Please sign in to comment.