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

project-name

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

project-name - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

24

index.js

@@ -22,3 +22,3 @@ /*!

module.exports = function (fp) {
module.exports = function(fp) {
return pkgname(fp) || gitname(fp) || basename(fp);

@@ -31,5 +31,10 @@ };

function pkgname(fp) {
var pkg = utils.pkg(fp);
if (pkg) return pkg.name;
function pkgname(dir) {
var file = utils.findPkg(dir);
if (file) {
try {
var pkg = require(path.resolve(file));
return pkg.name;
} catch (err) {}
}
return;

@@ -65,7 +70,10 @@ }

if (cached) return cached;
var dir = utils.cwd(fp);
if (fs.statSync(dir).isFile()) {
dir = path.dirname(dir);
}
var dir = utils.findPkg(fp);
try {
var stat = fs.statSync(dir);
if (stat.isFile()) {
dir = path.dirname(dir);
}
} catch (err) {}
return (cached = dir);
}
{
"name": "project-name",
"description": "Get the name of a project, from package.json, git config, or basename of the current working directory.",
"version": "0.2.1",
"version": "0.2.2",
"homepage": "https://github.com/jonschlinkert/project-name",

@@ -23,7 +23,7 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

},
"preferGlobal": true,
"dependencies": {
"cwd": "^0.8.4",
"git-repo-name": "^0.5.0",
"lazy-cache": "^0.2.4",
"load-pkg": "^2.0.1"
"find-pkg": "^0.1.0",
"git-repo-name": "^0.5.1",
"lazy-cache": "^0.2.4"
},

@@ -30,0 +30,0 @@ "devDependencies": {

@@ -1,2 +0,2 @@

# project-name [![NPM version](https://badge.fury.io/js/project-name.svg)](http://badge.fury.io/js/project-name)
# project-name [![NPM version](https://badge.fury.io/js/project-name.svg)](http://badge.fury.io/js/project-name) [![Build Status](https://travis-ci.org/jonschlinkert/project-name.svg)](https://travis-ci.org/jonschlinkert/project-name)

@@ -67,2 +67,2 @@ > Get the name of a project, from package.json, git config, or basename of the current working directory.

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 04, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 27, 2015._

@@ -27,5 +27,4 @@ 'use strict';

require('cwd');
require('git-repo-name', 'git');
require('load-pkg', 'pkg');
require('find-pkg');

@@ -32,0 +31,0 @@ /**

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