Socket
Socket
Sign inDemoInstall

main

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

main - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

8

index.js
var main = function() {
var Main = function(currentModule) {
// ran directly from the cli?
var ranDirectly = !module.parent.parent;
var ranDirectly = !currentModule.parent;
// no need to load optimist if we're not going to use it.

@@ -62,2 +62,4 @@ var optimist = ranDirectly ? require('optimist') : undefined;

*/
module.exports = new main();
module.exports = function(currentModule) {
return new Main(currentModule);
};
{
"name": "main",
"version": "0.0.6",
"version": "0.0.7",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -12,6 +12,15 @@ node-main

### require('main')
### require('main')(module)
Once required, you can chain the functions below
Once required, you can chain the functions below.
Note that the `module` part is required. This is to properly allow nesting of modules. e.g.
- `script1` contains `require('main')(module)`
- `script2` requires `script1`, and implements it's own `require('main')(module)`.
We expect that when running `script2` from the command line that it will only call the main function of `script2`, and not call the main function of `script1`.
For the time being, this is required until I or someone else figures out a way around it. Read the [caching section](http://nodejs.org/api/modules.html) of the Node Modules API for more information.
### .usage(message)

@@ -30,3 +39,3 @@

```javascript
require('main').flags({
require('main')(module).flags({
f: { alias: 'flag' },

@@ -63,3 +72,3 @@ t: { alias: 'secondFlag' },

require('main')
require('main')(module)
.usage('Usage:\n node test.js [flags] <word1> <word2>')

@@ -66,0 +75,0 @@ .flags({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc