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

base-cwd

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base-cwd - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

18

index.js

@@ -12,2 +12,3 @@ /*!

var isValid = require('is-valid-app');
var find = require('find-pkg');

@@ -17,2 +18,3 @@ module.exports = function(types) {

if (!isValid(app, 'base-cwd', types)) return;
var cached;

@@ -23,7 +25,9 @@ Object.defineProperty(this, 'cwd', {

set: function(cwd) {
this.cache.cwd = path.resolve(cwd);
cached = path.resolve(cwd);
this.cache.cwd = cached;
app.emit('cwd', cached);
},
get: function() {
if (typeof this.cache.cwd === 'string') {
return path.resolve(this.cache.cwd);
if (typeof cached === 'string') {
return path.resolve(cached);
}

@@ -33,2 +37,10 @@ if (typeof this.options.cwd === 'string') {

}
var pkgPath = find.sync(process.cwd());
if (pkgPath) {
var dir = path.dirname(pkgPath);
if (dir !== process.cwd()) {
app.emit('cwd', dir);
}
return dir;
}
return process.cwd();

@@ -35,0 +47,0 @@ }

{
"name": "base-cwd",
"description": "Base plugin that adds a getter/setter for the current working directory.",
"version": "0.2.1",
"version": "0.3.0",
"homepage": "https://github.com/node-base/base-cwd",

@@ -13,3 +13,5 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"files": [
"index.js"
"index.js",
"LICENSE",
"README.md"
],

@@ -24,3 +26,4 @@ "main": "index.js",

"dependencies": {
"is-valid-app": "^0.1.1"
"find-pkg": "^0.1.2",
"is-valid-app": "^0.2.0"
},

@@ -33,6 +36,16 @@ "devDependencies": {

"keywords": [
"api",
"app",
"application",
"base",
"baseplugin",
"cwd"
"building-blocks",
"create",
"cwd",
"framework",
"plugin",
"plugins",
"tool",
"toolkit",
"tools"
],

@@ -39,0 +52,0 @@ "verb": {

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