bare-module 6.1.3 → 6.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -540,6 +540,14 @@ A boolean representing whether the current module is the entry script where the
540
540
 
541
541
  A cache of loaded modules for this module. The same value as `module.cache` for the current module.
542
542
 
543
+ #### `import.meta.dirname`
544
+
545
+ The directory name of the current module.
546
+
547
+ #### `import.meta.filename`
548
+
549
+ The file name of the current module.
550
+
543
551
  #### `const href = import.meta.resolve(specifier[, parentURL])`
544
552
 
545
553
  A module-relative resolution function which returns the URL string for the module. The `specifier` is a string which is resolved relative to the `parentURL` which is a WHATWG URL.
package/index.js CHANGED
@@ -323,6 +323,9 @@ module.exports = exports = class Module {
323
323
  meta.main = module._main === module
324
324
  meta.cache = module._cache
325
325
 
326
+ meta.dirname = module.dirname // For Node.js compatibility
327
+ meta.filename = module.filename // For Node.js compatibility
328
+
326
329
  meta.resolve = function resolve(specifier, parentURL = referrer._url) {
327
330
  return self.resolve(specifier, toURL(parentURL, referrer._url), {
328
331
  referrer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-module",
3
- "version": "6.1.3",
3
+ "version": "6.2.0",
4
4
  "description": "Module support for JavaScript",
5
5
  "exports": {
6
6
  ".": {
@@ -20,7 +20,9 @@
20
20
  ],
21
21
  "addon": true,
22
22
  "scripts": {
23
- "test": "prettier . --check && bare test.js"
23
+ "format": "prettier --write . && lunte --fix",
24
+ "lint": "prettier --check . && lunte",
25
+ "test": "brittle-bare --coverage test.js"
24
26
  },
25
27
  "repository": {
26
28
  "type": "git",
@@ -46,6 +48,7 @@
46
48
  "bare-buffer": "^3.0.2",
47
49
  "brittle": "^3.1.1",
48
50
  "cmake-bare": "^1.1.6",
51
+ "lunte": "^1.6.0",
49
52
  "prettier": "^3.3.3",
50
53
  "prettier-config-holepunch": "^2.0.0"
51
54
  },