Git Product home page Git Product logo

node-git-root's Introduction

git-root

Build Status Build status Coverage Status

Get synchronously the git root path

Installation

$ npm i git-root --save

or

$ yarn add git-root

Usage

Returns:

  • String: The git root or empty string if it is not a git repository
const gitRoot = require('git-root');

gitRoot(); // '' or git root of process.cwd()
gitRoot('any/git/repo'); // '' or git root of the directory 'any/git/repo'

LICENSE

MIT © Jan Peer Stöcklmair

node-git-root's People

Contributors

jpeer264 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

node-git-root's Issues

Potential command injection vulnerability in node-git-root

Hi,

We would like to report a potential security vulnerability in node-git-root.
The bug is introduced because the package-exported method gitroot fails to sanitize the parameter and let it flow into a sensitive command execution API.

Here is the proof of concept.

const gitroot = require('git-root');
gitroot(". && touch cmd"). // a file named cmd will be created

Please consider fix it. thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.