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

chdir-promise

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chdir-promise - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json
{
"name": "chdir-promise",
"version": "0.2.0",
"version": "0.2.1",
"description": "Change working dir and return a promise, a stack of folders is maintained to jump back",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -23,8 +23,8 @@ # chdir-promise

```js
chdir.to('foo/bar/folder')
.then(function () {
return 'foo'; // value to return
})
.tap(chdir.back);
// resolved with value 'foo'
chdir.to('foo/bar/folder')
.then(function () {
return 'foo'; // value to return
})
.tap(chdir.back);
// resolved with value 'foo'
```

@@ -34,2 +34,15 @@

**Advice**
Put `chdir.back` into `.finally` callback to make sure it is always executed, even if there is an exception.
```js
chdir.to('foo/bar/folder')
.then(function () {
throw new Error('oh my');
})
.then(chdir.back) // not called!
.finally(chdir.back); // called
```
[q]: https://www.npmjs.com/package/q

@@ -36,0 +49,0 @@ [spots]: https://www.npmjs.com/package/spots

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