Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gumshoe

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gumshoe

Project type detection library for Node.JS using declarative heuristic predicates

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
48
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Gumshoe

Gumshoe picture

Project type detection library using declarative heuristic predicates.

Say you have a Git repo on disk, and you want to figure out what kind of language it is written in, what framework it uses, etc. With simple heuristics such as looking for a package.json file in the project root, this can be easily deduced.

Gumshoe makes it easy to specify these heuristics declaritively using predicates:


// Detect a node.js project
var rules = [
    {filename:"package.json", exists:true, language:"node.js"}
]

More complicated example:


// Detect a node.js project using connect, express or null frameworks
var rules = [
    {filename:"package.json", grep:/express/i, language:"node.js", framework:"express"},
    {filename:"package.json", grep:/connect/i, language:"node.js", framework:"connect"},
    {filename:"package.json", exists:true, language:"node.js", framework:null}
]

Installation

Gumshoe is available in NPM. npm install gumshoe

Example

  var gumshoe = require('gumshoe')

  // Use current working dir
  var baseDir = process.cwd()
  // Detect a node.js project
  var rules = [
      {filename:"package.json", exists:true, language:"node.js"}
  ]

  gumshoe.run(baseDir, rules, function(err, res) {
    if (err) {
        console.log("Detection error: %s", err)
        process.exit(1)
    }
    console.log("Detected language: %s", res.language)
  })

Tests

Gumshoe comes with tests. To run, simply execute npm test.

License

Gumshoe is released under a BSD license.

Credits

Picture of Legoman gumshoe CC-BY David Anderson from http://www.flickr.com/photos/venndiagram/5328211162/

Keywords

FAQs

Package last updated on 27 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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