# project-name [![NPM version](https://img.shields.io/npm/v/project-name.svg?style=flat)](https://www.npmjs.com/package/project-name) [![NPM downloads](https://img.shields.io/npm/dm/project-name.svg?style=flat)](https://npmjs.org/package/project-name) [![Build Status](https://img.shields.io/travis/jonschlinkert/project-name.svg?style=flat)](https://travis-ci.org/jonschlinkert/project-name) Get the name of a project, from package.json, git config, or basename of the current working directory. ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm install --save project-name ``` ## Usage The project name is resolved in this order: 1. check for package.json, if exists `name` is returned 2. check for git repository, if exists return repository `name` 3. use the `path.basename` of the current working directory ```js var name = require('project-name'); name(); //=> project-name ``` Optionally specify a current working directory: ```js var name = require('project-name'); name('foo'); ``` ## Related projects You might also be interested in these projects: * [git-repo-name](https://www.npmjs.com/package/git-repo-name): Get the repository name from the git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-repo-name "Get the repository name from the git remote origin URL.") * [git-user-email](https://www.npmjs.com/package/git-user-email): Get the email address of the current user from git config. | [homepage](https://github.com/jonschlinkert/git-user-email "Get the email address of the current user from git config.") * [git-user-name](https://www.npmjs.com/package/git-user-name): Get a user's name from git config at the project or global scope, depending on… [more](https://github.com/jonschlinkert/git-user-name) | [homepage](https://github.com/jonschlinkert/git-user-name "Get a user's name from git config at the project or global scope, depending on what git uses in the current context.") * [git-username](https://www.npmjs.com/package/git-username): Get the username from a git remote origin URL. | [homepage](https://github.com/jonschlinkert/git-username "Get the username from a git remote origin URL.") ## Contributing This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit directly. Any changes to the readme must be made in [.verb.md](.verb.md). See [Building Docs](#building-docs). Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). Or visit the [verb-readme-generator](https://github.com/verbose/verb-readme-generator) project to submit bug reports or pull requests for the readme layout template. ## Building docs _(This document was generated by [verb-readme-generator](https://github.com/verbose/verb-readme-generator) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ Generate readme and API documentation with [verb](https://github.com/verbose/verb): ```sh $ npm install -g verb verb-readme-generator && verb ``` ## Running tests Install dev dependencies: ```sh $ npm install -d && npm test ``` ## Author **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) * [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). Released under the [MIT license](https://github.com/jonschlinkert/project-name/blob/master/LICENSE). *** _This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on July 13, 2016._