Compare commits

..

7 Commits

Author SHA1 Message Date
Timothée Rebours 77d1b14180 4.0.3 12 months ago
Timothée Rebours db831168d3 changelog 12 months ago
tex0l 2229821d71
Merge pull request #49 from seald/48-eperm-root-directory-win32 12 months ago
Timothée Rebours 6903ffa42b 4.0.3-1 12 months ago
Timothée Rebours afe1831485 fix more properly #48 after reading path.parse documentation more thoroughly 12 months ago
Timothée Rebours 03217cead9 4.0.3-0 12 months ago
Timothée Rebours a83e80759d Fix #48 12 months ago
  1. 4
      CHANGELOG.md
  2. 6
      lib/persistence.js
  3. 4
      package-lock.json
  4. 2
      package.json

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres and this project adheres
to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4.0.3] - 2023-12-13
### Fixed
- Fixed EPERM Exception when datastore is at the root of a disk on Windows [#48](https://github.com/seald/nedb/issues/48)
## [4.0.2] - 2023-05-05 ## [4.0.2] - 2023-05-05
### Fixed ### Fixed
- Fixed typo in documentation [#36](https://github.com/seald/nedb/pull/36) - Fixed typo in documentation [#36](https://github.com/seald/nedb/pull/36)

@ -373,7 +373,11 @@ class Persistence {
* @private * @private
*/ */
static async ensureDirectoryExistsAsync (dir, mode = DEFAULT_DIR_MODE) { static async ensureDirectoryExistsAsync (dir, mode = DEFAULT_DIR_MODE) {
await storage.mkdirAsync(dir, { recursive: true, mode }) const parsedDir = path.parse(path.resolve(dir))
// this is because on Windows mkdir throws a permission error when called on the root directory of a volume
if (process.platform !== 'win32' || parsedDir.dir !== parsedDir.root || parsedDir.base !== '') {
await storage.mkdirAsync(dir, { recursive: true, mode })
}
} }
} }

4
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "@seald-io/nedb", "name": "@seald-io/nedb",
"version": "4.0.2", "version": "4.0.3",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@seald-io/nedb", "name": "@seald-io/nedb",
"version": "4.0.2", "version": "4.0.3",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@seald-io/binary-search-tree": "^1.0.3", "@seald-io/binary-search-tree": "^1.0.3",

@ -1,6 +1,6 @@
{ {
"name": "@seald-io/nedb", "name": "@seald-io/nedb",
"version": "4.0.2", "version": "4.0.3",
"files": [ "files": [
"lib/**/*.js", "lib/**/*.js",
"browser-version/**/*.js", "browser-version/**/*.js",

Loading…
Cancel
Save