How to use the d/package.name function in d

To help you get started, we’ve selected a few d examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benjamn / install / test / run.js View on Github external
module.exports = module.prefetch("./b").then(function (id) {
          assert.strictEqual(id, "/b.js");
          assert.strictEqual(require("./b").name, id);
          assert.strictEqual(require("./c").name, "/c.js");

          assert.strictEqual(
            require("d").name,
            "/node_modules/d/index.js"
          );

          assert.strictEqual(
            require("d/package").name,
            "/node_modules/d/package.json"
          );

          return module.prefetch("./nonexistent").catch(function (error) {
            assert.ok(error instanceof Error);
            assert.ok(error.message.startsWith("Cannot find module"));
          });
        });
      },

d

Property descriptor factory

ISC
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis