which-native-nodish
Find out if your module or directory is contained in a node-webkit or atom-shell project
Last updated 10 years ago by maxkorp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install which-native-nodish 
SYNC missed versions from official npm registry.

which-native-nodish

Formerly for-node-webkit.

which-native-nodish is a tool for detecting if a given directory or package is contained within a node-webkit/nw.js or atom-shell project, particularly useful for build time applications in native modules, where nw-gyp must be used instead of node-gyp for nw.js, or a series of flags must be passed for atom-shell. It works by finding the root most package.json from the specified directory, and checking it's engines property for node-webkit or nw.js and atom-shell properties.

##Commandline usage: Specify the directory to check against (which-native-nodish will search it's immediate parent and up), or if unspecified, it defaults to the current working directory.

which-native-nodish "./mydir/someprojectiwanttoknowabout"
which-native-nodish

##Module usage: The module returns a function that returns a promise, resolving with 3 properties: root, nwVersion and asVersion.

To find out if the current module resides in a node webkit project:

  var wnn = require('which-native-nodish');
  wnn(__dirname).then(function(results) {
    if (!results.root) {
      // Couldnt find a parent module
    }
    else if (results.nwVersion) {
      // nwVersion is the version of node-webkit/nw.js
    }
    else if (results.asVersion) {
      // asVersion is the version of atom-shell
    }
    else {
      // Root module doesnt use node webkit or atom-shell 
    }
  });

Current Tags

  • 1.1.3                                ...           latest (9 years ago)

8 Versions

  • 1.1.3                                ...           9 years ago
  • 1.1.2                                ...           9 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2 [deprecated]           ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE