Skip to content

Instantly share code, notes, and snippets.

@deinspanjer deinspanjer/cli.js Secret
Created May 21, 2017

Embed
What would you like to do?
#!/usr/bin/env node
'use strict';
const config = require('npm-package-config').list()
console.log(config)
...
{ package__args_0_0_raw: 'npm-package-config',
package__args_0_0_scope: null,
package__args_0_0_escapedName: 'npm-package-config',
package__args_0_0_name: 'npm-package-config',
package__args_0_0_rawSpec: '',
package__args_0_0_spec: 'latest',
package__args_0_0_type: 'tag',
package__args_0_1: '/Users/dre/src/node-plv8',
package__from: 'npm-package-config@latest',
package__id: 'npm-package-config@0.1.9',
package__inCache: true,
package__location: '/npm-package-config',
package__nodeVersion: '7.4.0',
package__npmOperationalInternal_host: 'packages-18-east.internal.npmjs.com',
package__npmOperationalInternal_tmp: 'tmp/npm-package-config-0.1.9.tgz_1483632716034_0.7166434961836785',
package__npmUser_name: 'doodadjs',
package__npmUser_email: 'doodadjs@gmail.com',
package__npmVersion: '4.0.5',
package__requested_raw: 'npm-package-config',
package__requested_scope: null,
package__requested_escapedName: 'npm-package-config',
package__requested_name: 'npm-package-config',
package__requested_rawSpec: '',
package__requested_spec: 'latest',
package__requested_type: 'tag',
package__requiredBy_0: '#USER',
package__requiredBy_1: '/',
package__resolved: 'https://registry.npmjs.org/npm-package-config/-/npm-package-config-0.1.9.tgz',
package__shasum: '37f53d75ab27366eecab46723efbb54008092ec6',
package__shrinkwrap: null,
package__spec: 'npm-package-config',
package__where: '/Users/dre/src/node-plv8',
package_author_name: 'Claude Petit',
package_author_email: 'doodadjs@gmail.com',
package_author_url: 'https://github.com/doodadjs/',
package_browser: './browserify.js',
package_bugs_url: 'https://github.com/doodadjs/npm-package-config/issues',
package_bugs_email: 'doodadjs@gmail.com',
package_description: 'Retrieves and combines package\'s configuration like running from \'npm run\'',
package_dist_shasum: '37f53d75ab27366eecab46723efbb54008092ec6',
package_dist_tarball: 'https://registry.npmjs.org/npm-package-config/-/npm-package-config-0.1.9.tgz',
package_files_0: 'browserify',
package_files_1: 'index.js',
package_files_2: 'README.md',
package_files_3: 'LICENSE',
package_files_4: 'browserify.js',
package_files_5: 'tonic.js',
package_homepage: 'https://github.com/doodadjs/npm-package-config#readme',
package_keywords_0: 'npm',
package_keywords_1: 'config',
package_license: 'MIT',
package_main: 'index.js',
package_maintainers_0_name: 'doodadjs',
package_maintainers_0_email: 'doodadjs@gmail.com',
package_name: 'npm-package-config',
package_readme: 'ERROR: No README data found!',
package_repository_type: 'git',
package_repository_url: 'git+https://github.com/doodadjs/npm-package-config.git',
package_scripts_test: 'echo "Error: no test specified" && exit 1',
package_tonicExampleFilename: 'tonic.js',
package_version: '0.1.9',
'': undefined }
{
"name": "plv8",
"description": "require() node.js modules in plv8",
"bin": "./lib/cli.js",
...
"config": {
"schema": "v8",
"modules_table": "modules",
"pg_user": "postgres",
"pg_host": "localhost",
"pg_port": 5432,
"pg_database": "postgres"
},
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.