Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import figgyPudding from 'figgy-pudding'
import libnpm from 'libnpm'
import npmlog from 'npmlog'
import { h, renderToString } from 'ink'
import { PackageView, PackageFields } from '../components/view.jsx'
const ViewOpts = figgyPudding({
field: {},
json: {},
log: { default: () => npmlog },
'pkg@version': {}
})
export default async function (argv, opts) {
opts = ViewOpts(opts)
let { 'pkg@version': spec, field: fields } = opts
if (!spec) { spec = '.' }
if (!fields) { fields = [] }
const packument = await libnpm.packument(spec, opts.concat({
fullMetadata: true