{
  "_id": "import-from",
  "maintainers": [
    {
      "name": "sindresorhus",
      "email": "sindresorhus@gmail.com"
    }
  ],
  "keywords": [
    "require",
    "resolve",
    "path",
    "module",
    "from",
    "like",
    "import",
    "path"
  ],
  "dist-tags": {
    "latest": "4.0.0"
  },
  "author": {
    "name": "Sindre Sorhus",
    "email": "sindresorhus@gmail.com",
    "url": "https://sindresorhus.com"
  },
  "_rev": "9-b8406b925f93a7245e7825581aec0ef8",
  "description": "Import a module like with `require()` but from a given path",
  "readme": "# import-from\n\n> Import a module like with [`require()`](https://nodejs.org/api/modules.html#modules_require_id) but from a given path\n\n## Install\n\n```\n$ npm install import-from\n```\n\n## Usage\n\n```js\nconst importFrom = require('import-from');\n\n// There is a file at `./foo/bar.js`\n\nimportFrom('foo', './bar');\n```\n\n## API\n\n### importFrom(fromDirectory, moduleId)\n\nLike `require()`, throws when the module can't be found.\n\n### importFrom.silent(fromDirectory, moduleId)\n\nReturns `undefined` instead of throwing when the module can't be found.\n\n#### fromDirectory\n\nType: `string`\n\nDirectory to import from.\n\n#### moduleId\n\nType: `string`\n\nWhat you would use in `require()`.\n\n## Tip\n\nCreate a partial using a bound function if you want to import from the same `fromDir` multiple times:\n\n```js\nconst importFromFoo = importFrom.bind(null, 'foo');\n\nimportFromFoo('./bar');\nimportFromFoo('./baz');\n```\n\n## Related\n\n- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory\n- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path\n- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory\n- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point\n- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily\n- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module\n",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/sindresorhus/import-from.git"
  },
  "users": {
    "rocket0191": true,
    "flumpus-dev": true
  },
  "bugs": {
    "url": "https://github.com/sindresorhus/import-from/issues"
  },
  "license": "MIT",
  "versions": {
    "2.1.0": {
      "name": "import-from",
      "version": "2.1.0",
      "description": "Import a module like with `require()` but from a given path",
      "license": "MIT",
      "repository": {
        "type": "git",
        "url": "git+https://github.com/sindresorhus/import-from.git"
      },
      "author": {
        "name": "Sindre Sorhus",
        "email": "sindresorhus@gmail.com",
        "url": "sindresorhus.com"
      },
      "engines": {
        "node": ">=4"
      },
      "scripts": {
        "test": "xo && ava"
      },
      "files": [
        "index.js"
      ],
      "keywords": [
        "require",
        "resolve",
        "path",
        "module",
        "from",
        "like",
        "import",
        "path"
      ],
      "dependencies": {
        "resolve-from": "^3.0.0"
      },
      "devDependencies": {
        "ava": "*",
        "xo": "*"
      },
      "gitHead": "c7d2eb8ebdb94873445632b2273d2d52030a7dc8",
      "bugs": {
        "url": "https://github.com/sindresorhus/import-from/issues"
      },
      "homepage": "https://github.com/sindresorhus/import-from#readme",
      "_id": "import-from@2.1.0",
      "_shasum": "335db7f2a7affd53aaa471d4b8021dee36b7f3b1",
      "_from": ".",
      "_npmVersion": "4.2.0",
      "_nodeVersion": "7.10.0",
      "_npmUser": {
        "name": "sindresorhus",
        "email": "sindresorhus@gmail.com"
      },
      "dist": {
        "shasum": "335db7f2a7affd53aaa471d4b8021dee36b7f3b1",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/import-from/-/import-from-2.1.0.tgz",
        "integrity": "sha512-0vdnLL2wSGnhlRmzHJAg5JHjt1l2vYhzJ7tNLGbeVg0fse56tpGaH0uzH+r9Slej+BSXXEHvBKDEnVSLLE9/+w==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCICLECENXt5o4ZzfZSXCW6em+kYLmV03ADDiKYqLOpR59AiEAtPMDuyBtXTQzCdrRPN/+RENs3t67ifQd/ujRWrVlP/s="
          }
        ]
      },
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/import-from-2.1.0.tgz_1495358911498_0.48687195940874517"
      },
      "directories": {}
    },
    "3.0.0": {
      "name": "import-from",
      "version": "3.0.0",
      "description": "Import a module like with `require()` but from a given path",
      "license": "MIT",
      "repository": {
        "type": "git",
        "url": "git+https://github.com/sindresorhus/import-from.git"
      },
      "author": {
        "name": "Sindre Sorhus",
        "email": "sindresorhus@gmail.com",
        "url": "sindresorhus.com"
      },
      "engines": {
        "node": ">=8"
      },
      "scripts": {
        "test": "xo && ava && tsd"
      },
      "keywords": [
        "require",
        "resolve",
        "path",
        "module",
        "from",
        "like",
        "import",
        "path"
      ],
      "dependencies": {
        "resolve-from": "^5.0.0"
      },
      "devDependencies": {
        "ava": "^1.4.1",
        "tsd": "^0.7.2",
        "xo": "^0.24.0"
      },
      "gitHead": "fb039dcf3fe69bb3d395be4b5db2ab9367efcca7",
      "bugs": {
        "url": "https://github.com/sindresorhus/import-from/issues"
      },
      "homepage": "https://github.com/sindresorhus/import-from#readme",
      "_id": "import-from@3.0.0",
      "_nodeVersion": "10.15.3",
      "_npmVersion": "6.9.0",
      "_npmUser": {
        "name": "sindresorhus",
        "email": "sindresorhus@gmail.com"
      },
      "dist": {
        "integrity": "sha512-CiuXOFFSzkU5x/CR0+z7T91Iht4CXgfCxVOFRhh2Zyhg5wOpWvvDLQUsWl+gcN+QscYBjez8hDCt85O7RLDttQ==",
        "shasum": "055cfec38cd5a27d8057ca51376d7d3bf0891966",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/import-from/-/import-from-3.0.0.tgz",
        "fileCount": 5,
        "unpackedSize": 5024,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcxC9KCRA9TVsSAnZWagAAIQgP/2QadK4xKtpUI/ZAhEWa\nx9EaePC/LYP+mMUK7/iQlfPlZZ3jI0JItnppqZO6Tc6Z2oC8cTHDzI7OlZCf\nU15NLwquFbMKkTKVYqTTB3d+Ol0cjR8bxD8KVlknBj6S/RA2FIXl1a8mbpce\n1V0p4LfRcxr4ANUwOUXJXdDDaCSnW136vgp4mdX0p1XhR8920cxDIKoQG/Ot\nAjA9b+c7uoA9ZhgC9fuvLlI3wGEIe6XuSEb8VKpr4Y8tayTgRXf+qFZoem/a\nbf/a23n/32Gr0s7ZbUi+Z7AMcpcTA/npyTHNs8HlGj2a7xMWrABpDchM2v4u\nHZsoi5cUfI448/WT3DsZQeqro0KOwq3cWxkI7Sn2lfejQRSIxiD9hGQC+fkI\npvC6fpTaFsxE9oLEVgtIOnXZoITqMvkiQQaL755oXURoZ49i1BQI/yv2vrDK\nlGz7ReVSecm4Ewh5Unjs7eWq05SIbK1I2I9Nso41Jp4SMMW6S1qaGG83Izu9\nEDWNddcsTwmeTcM5rG64UMaXHL/0cH+MPlZOFspGdhyzmrgBFSH9bjmZr2SM\n6IAD9pFLvlccXfzK2Gj/aidxpLAlHqiKQvQ/VrIFrvMiY0MeyDU5WrVrnPyH\nDdjEg/Jx4ydW6bZ+yb9cw12dzRcnhVwbNbvLbBRRAxfGy764et5aqUxCI7Ao\n2vA1\r\n=nZSD\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQDxUU4a/SUdMKTixF4WlQil82uPVNrE+F7Qy+Kmq1NEWQIhAOfD859mNbXImE8VOgTi+ecX3Hl8kXR2r5N7noZ+29hj"
          }
        ]
      },
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "directories": {},
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/import-from_3.0.0_1556361033390_0.7896283829815032"
      },
      "_hasShrinkwrap": false
    },
    "4.0.0": {
      "name": "import-from",
      "version": "4.0.0",
      "description": "Import a module like with `require()` but from a given path",
      "license": "MIT",
      "repository": {
        "type": "git",
        "url": "git+https://github.com/sindresorhus/import-from.git"
      },
      "funding": "https://github.com/sponsors/sindresorhus",
      "author": {
        "name": "Sindre Sorhus",
        "email": "sindresorhus@gmail.com",
        "url": "https://sindresorhus.com"
      },
      "engines": {
        "node": ">=12.2"
      },
      "scripts": {
        "test": "xo && ava && tsd"
      },
      "keywords": [
        "require",
        "resolve",
        "path",
        "module",
        "from",
        "like",
        "import",
        "path"
      ],
      "devDependencies": {
        "ava": "^1.4.1",
        "tsd": "^0.7.2",
        "xo": "^0.24.0"
      },
      "gitHead": "c411bcaaa489069d9e17c232aa4d01f716ae7bd7",
      "bugs": {
        "url": "https://github.com/sindresorhus/import-from/issues"
      },
      "homepage": "https://github.com/sindresorhus/import-from#readme",
      "_id": "import-from@4.0.0",
      "_nodeVersion": "16.0.0",
      "_npmVersion": "7.10.0",
      "dist": {
        "integrity": "sha512-P9J71vT5nLlDeV8FHs5nNxaLbrpfAV5cF5srvbZfpwpcJoM/xZR3hiv+q+SAnuSmuGbXMWud063iIMx/V/EWZQ==",
        "shasum": "2710b8d66817d232e16f4166e319248d3d5492e2",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/import-from/-/import-from-4.0.0.tgz",
        "fileCount": 5,
        "unpackedSize": 4909,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgteatCRA9TVsSAnZWagAAPjAP/102c7DSx1nQFmi64xOd\nU2WuDMC3AJMbHuFMcHijKC19XVNb4pLSS8T0TpNBhJ6qo9xJ/hQDGQIHB4rv\nPEMrMmVtjSOcNTyPem9u3mylieKgdKZ8W21BxCvPkv1wgCu2KBwFchniw1bN\nSNeuDAgM1xt+FGJfwcVHizdoEclO+d2It2rEJZk6Hup/Hghu7HIDHAJOtBGg\nX/0PkhDEpvhx0duHdvNUHK5FDORMobcvIRRwRUyt8Q+lzKJeYPx6MNoY84YY\nM4XolDMyIgv675PvXtJLas2G+WOea8HAmhjFVWAXUOjcXU0FkLV1m/WZmUl2\nJYlIrMN6oXWMWC4cRZJB4rojkX3Bey3x8HYuUybWp/anQvB0+XMNyP517lMQ\nprdbWnEvn0nf8DOlYHVhS335czA6e7kq3whf8K/5eXhrGVmztTsPYbP3DTd5\nS34cudihGZgyMHsgNfhndGNt+Ht3pqTIW3gCbfb1ud2rxGHYR1GVELFHHk61\np7k7QjyJvy2Vak52CxXy/wFnlQxGDxUKGSEY5FrGuYSv71sTFNXJXrT/5ush\n1V0A3oP8CNZoka1dBSjleaqbtmvmpmcQug/VT8v52ajlwWneMsESjBdi+snc\nbABc1lcY3mro/qxSlTGIrUOH8EB7IZfuCHyU6OWTl7a+dcjbIzEaHbTiD6o2\nbLYd\r\n=fS6h\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEYCIQCjwQKINfd9qAJNd3QJnaTSW89Cin88O/WCvvg0+ln2kAIhAJWW0sQ9hKT9FIQEI/xJSSdpPZme8Gz8bU6HyyrRjPu8"
          }
        ]
      },
      "_npmUser": {
        "name": "sindresorhus",
        "email": "sindresorhus@gmail.com"
      },
      "directories": {},
      "maintainers": [
        {
          "name": "sindresorhus",
          "email": "sindresorhus@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/import-from_4.0.0_1622533805046_0.05245298393180442"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "import-from",
  "time": {
    "modified": "2026-05-24T07:56:32.790Z",
    "created": "2017-05-21T09:28:31.839Z",
    "2.1.0": "2017-05-21T09:28:31.839Z",
    "3.0.0": "2019-04-27T10:30:33.530Z",
    "4.0.0": "2021-06-01T07:50:05.141Z"
  },
  "readmeFilename": "readme.md",
  "homepage": "https://github.com/sindresorhus/import-from#readme"
}