Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Resolve Node.js module information
CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
.npmignore
Gruntfile.coffee
LICENSE
README.md
package.json

README.md

ja-resolve

Resolve Node.js module information. Returns the module main file and also the package information (path and package.json contents).

install

npm install ja-resolve

usage (coffee-script)

resolve = require 'ja-resolve'

resolve 'lodash', '/home/joe/code/project', (err, res) ->
  if err?
    console.log err
  else
    console.log "Found file: #{res.path}"
    if res.pkg?
      console.log "Module: #{res.pkg.path}, version: #{res.pkg.json.version}"
Something went wrong with that request. Please try again.