Use libnpmaccess to manage npm package access and permissions
latestlibnpmaccess is a Node.js library that provides programmatic access to the functionality of the npm access CLI command. It allows you to manage account MFA settings, list packages and permissions, view package collaborators, and define permissions for users, organizations, and teams.
const access = require('libnpmaccess')
const opts = { '//registry.npmjs.org/:_authToken: 'npm_token }
// List all packages @zkat has access to on the npm registry.
console.log(Object.keys(await access.getPackages('zkat', opts)))