| Server IP : 198.38.94.67 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : Linux d6054.dxb1.stableserver.net 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64 User : azfilmst ( 1070) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/node_modules/npm/node_modules/npm-packlist/bin/ |
Upload File : |
#!/usr/bin/env node
'use strict'
const packlist = require('../')
const dirs = []
let doSort = false
process.argv.slice(2).forEach(arg => {
if (arg === '-h' || arg === '--help') {
console.log('usage: npm-packlist [-s --sort] [directory, directory, ...]')
process.exit(0)
} else if (arg === '-s' || arg === '--sort') {
doSort = true
} else {
dirs.push(arg)
}
})
const sort = list => doSort ? list.sort((a, b) => a.localeCompare(b, 'en')) : list
const main = async () => {
if (!dirs.length) {
const results = await packlist({ path: process.cwd() })
console.log(sort(results).join('\n'))
} else {
for (const dir of dirs) {
console.group(`> ${dir}`)
const results = await packlist({ path: dir })
console.log(sort(results).join('\n'))
console.groupEnd()
}
}
}
// coverage disabled for catch handler because we don't need to test that
main().catch(/* istanbul ignore next */(err) => {
process.exitCode = 1
console.error(err.stack)
})