Universal importer for CommonJS and ESM in Node.js

Overview

ModuleImporter

by Nicholas C. Zakas

If you find this useful, please consider supporting my work with a donation.

Description

A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses import() and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues.

The problem with the default import() is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory.

Usage

Node.js

Install using npm or yarn:

npm install @humanwhocodes/module-importer

# or

yarn add @humanwhocodes/module-importer

Import into your Node.js project:

// CommonJS
const { ModuleImporter } = require("@humanwhocodes/module-importer");

// ESM
import { ModuleImporter } from "@humanwhocodes/module-importer";

Bun

Install using this command:

bun add @humanwhocodes/module-importer

Import into your Bun project:

import { ModuleImporter } from "@humanwhocodes/module-importer";

API

After importing, create a new instance of ModuleImporter to start emitting events:

// cwd can be omitted to use process.cwd()
const importer = new ModuleImporter(cwd);

// you can resolve the location of any package
const location = importer.resolve("./some-file.cjs");

// you can also import directly
const module = importer.import("./some-file.cjs");

For both resolve() and import(), you can pass in package names and filenames.

Developer Setup

  1. Fork the repository
  2. Clone your fork
  3. Run npm install to setup dependencies
  4. Run npm test to run tests

License

Apache 2.0

Comments
  • chore(main): release 1.0.1

    chore(main): release 1.0.1

    :robot: I have created a release beep boop

    1.0.1 (2022-08-18)

    Bug Fixes

    • Ensure CommonJS mode works correctly. (cf54a0b), closes #6

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore: release 1.0.0

    chore: release 1.0.0

    :robot: I have created a release *beep* *boop*

    1.0.0 (2022-08-17)

    Features

    • Implement ModuleImporter (3ce4e82)

    This PR was generated with Release Please. See documentation.

    autorelease: tagged 
    opened by github-actions[bot] 1
  • chore: release 1.0.1

    chore: release 1.0.1

    :robot: I have created a release *beep* *boop*

    1.0.1 (2022-08-18)

    Bug Fixes

    • Ensure CommonJS mode works correctly. (cf54a0b), closes #6

    This PR was generated with Release Please. See documentation.

    autorelease: pending 
    opened by github-actions[bot] 0
  • chore(deps): update googlecloudplatform/release-please-action action to v3

    chore(deps): update googlecloudplatform/release-please-action action to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | GoogleCloudPlatform/release-please-action | action | major | v2 -> v3 |


    Release Notes

    GoogleCloudPlatform/release-please-action

    v3

    Compare Source


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency rollup to v2.78.0

    chore(deps): update dependency rollup to v2.78.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | rollup (source) | 2.77.2 -> 2.78.0 | age | adoption | passing | confidence |


    Release Notes

    rollup/rollup

    v2.78.0

    Compare Source

    2022-08-14

    Features
    • Support writing plugin hooks as objects with a "handler" property (#​4600)
    • Allow changing execution order per plugin hook (#​4600)
    • Add flag to execute plugins in async parallel hooks sequentially (#​4600)
    Pull Requests

    v2.77.3

    Compare Source

    2022-08-11

    Bug Fixes
    • Correctly resolve preserveModulesRoot in Vite (#​4591)
    Pull Requests

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency eslint to v8.22.0

    chore(deps): update dependency eslint to v8.22.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | eslint (source) | 8.21.0 -> 8.22.0 | age | adoption | passing | confidence |


    Release Notes

    eslint/eslint

    v8.22.0

    Compare Source

    Features

    • 2b97607 feat: Implement caching for FlatESLint (#​16190) (Nicholas C. Zakas)
    • fd5d3d3 feat: add methodsIgnorePattern option to object-shorthand rule (#​16185) (Milos Djermanovic)

    Documentation

    Chores

    • 10a6e0e chore: remove deploy workflow for playground (#​16186) (Milos Djermanovic)

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): pin dependency @types/node to 18.7.6 - autoclosed

    chore(deps): pin dependency @types/node to 18.7.6 - autoclosed

    Mend Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | @types/node (source) | devDependencies | pin | ^18.7.6 -> 18.7.6 |

    Add the preset :preserveSemverRanges to your config if you don't want to pin your dependencies.


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/nodejs-test.yml (github-actions)
    • .github/workflows/release-please.yml (github-actions)
    • package.json (npm)

    Configuration Summary

    Based on the default config's presets, Renovate will:

    • Start dependency updates only once this onboarding PR is merged
    • Enable Renovate Dependency Dashboard creation.
    • If Renovate detects semantic commits, it will use semantic commit type fix for dependencies and chore for all others.
    • Ignore node_modules, bower_components, vendor and various test/tests directories.
    • Autodetect whether to pin dependencies or maintain ranges.
    • Rate limit PR creation to a maximum of two per hour.
    • Limit to maximum 10 open PRs at any time.
    • Group known monorepo packages together.
    • Use curated list of recommended non-monorepo package groupings.
    • A collection of workarounds for known problems with packages.

    🔡 Would you like to change the way Renovate is upgrading your dependencies? Simply edit the renovate.json in this branch with your custom config and the list of Pull Requests in the "What to Expect" section below will be updated the next time Renovate runs.


    What to Expect

    With your current configuration, Renovate will create 5 Pull Requests:

    chore(deps): pin dependency @​types/node to 18.7.6
    • Schedule: ["at any time"]
    • Branch name: renovate/pin-dependencies
    • Merge into: main
    • Pin @types/node to 18.7.6
    chore(deps): update dependency eslint to v8.22.0
    • Schedule: ["at any time"]
    • Branch name: renovate/eslint-8.x
    • Merge into: main
    • Upgrade eslint to 8.22.0
    chore(deps): update dependency rollup to v2.78.0
    • Schedule: ["at any time"]
    • Branch name: renovate/rollup-2.x
    • Merge into: main
    • Upgrade rollup to 2.78.0
    chore(deps): update dependency mocha to v10
    • Schedule: ["at any time"]
    • Branch name: renovate/mocha-10.x
    • Merge into: main
    • Upgrade mocha to 10.0.0
    chore(deps): update googlecloudplatform/release-please-action action to v3

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency chai to v4.3.7

    chore(deps): update dependency chai to v4.3.7

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | chai (source) | 4.3.6 -> 4.3.7 | age | adoption | passing | confidence |


    Release Notes

    chaijs/chai

    v4.3.7

    Compare Source

    What's Changed

    Full Changelog: https://github.com/chaijs/chai/compare/v4.3.6...v4.3.7


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency rollup to v3

    chore(deps): update dependency rollup to v3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | rollup (source) | 2.78.0 -> 3.3.0 | age | adoption | passing | confidence |


    Release Notes

    rollup/rollup

    v3.3.0

    Compare Source

    2022-11-12

    Features
    • Add "experimentalMinChunkSize" option to merge smaller chunks into larger ones (#​4705)
    • Automatically deduplicate assets again when the source is a Buffer (#​4712)
    • Deduplicate Buffer with string assets (#​4712)
    Bug Fixes
    • Support plugins with object hooks when using perf: true (#​4707)
    Pull Requests

    v3.2.5

    Compare Source

    2022-11-01

    Bug Fixes
    • We deconflicting classes, ensure the original class name still does not shadow variables (#​4697)
    Pull Requests

    v3.2.4

    Compare Source

    2022-10-31

    Bug Fixes
    • Always use forward slashes in chunk ids when preserving modules, even on Windows (#​4693)
    • Escape problematic characters in ids when rewriting import.meta.url (#​4693)
    Pull Requests

    v3.2.3

    Compare Source

    2022-10-18

    Bug Fixes
    • Fix an issue whre Rollup confused new.target with import.meta (#​4679)
    • Ensure that Rollup does not make assumptions about the value of unknown namespace import members (#​4684)
    Pull Requests

    v3.2.2

    Compare Source

    2022-10-16

    Bug Fixes
    • Do not hang/crash on hashbang comments in input modules (#​4676)
    Pull Requests

    v3.2.1

    Compare Source

    2022-10-16

    Bug Fixes
    • Rewrite class declarations to preserve their .name property if necessary (#​4674)
    Pull Requests

    v3.2.0

    Compare Source

    2022-10-15

    Features
    • Support providing Promises as plugins like Vite (#​4671)
    Pull Requests

    v3.1.0

    Compare Source

    2022-10-12

    Features
    • Support using arrays of plugins as plugins like Vite (#​4657)
    Pull Requests

    v3.0.1

    Compare Source

    2022-10-12

    Bug Fixes
    • Fix installation on Windows (#​4662)
    • Avoid missing parameters that are only used in a destructuring initializer (#​4663)
    Pull Requests

    v3.0.0

    Compare Source

    2022-10-11

    Breaking Changes
    General Changes
    • Rollup now requires at least Node 14.18.0 to run (#​4548 and #​4596)
    • The browser build has been split into a separate package @rollup/browser (#​4593)
    • The node build uses the node: prefix for imports of builtin modules (#​4596)
    • Some previously deprecated features have been removed (#​4552):
      • Some plugin context functions have been removed:
        • this.emitAsset(): use this.emitFile()
        • this.emitChunk(): use this.emitFile()
        • this.getAssetFileName(): use this.getFileName()
        • this.getChunkFileName(): use this.getFileName()
        • this.isExternal(): use this.resolve()
        • this.resolveId(): use this.resolve()
      • The resolveAssetUrl plugin hook has been removed: use resolveFileUrl
      • Rollup no longer passes assetReferenceId or chunkReferenceId parameters to resolveFileUrl
      • The treeshake.pureExternalModules option has been removed: use treeshake.moduleSideEffects: 'no-external'
      • You may no longer use true or false for output.interop. As a replacement for true, you can use "compat"
      • Emitted assets no longer have an isAsset flag in the bundle
      • Rollup will no longer fix assets added directly to the bundle by adding the type: "asset" field
    • Some features that were previously marked for deprecation now show warnings when used (#​4552):
      • Some options have been deprecated:
        • inlineDynamicImports as part of the input options: use output. inlineDynamicImports
        • manualChunks as part of the input options: use output. manualChunks
        • maxParallelFileReads: use `maxParallelFileOps
        • output.preferConst: use output.generatedCode.constBindings
        • output.dynamicImportFunction: use the renderDynamicImport plugin hook
        • output.namespaceToStringTag: use output.generatedCode.symbols
        • preserveModules as part of the input options: use output. preserveModules
      • You should no longer access this.moduleIds in plugins: use this.getModuleIds()
      • You should no longer access this.getModuleInfo(...).hasModuleSideEffects in plugins: use this.getModuleInfo(...).moduleSideEffects
    • Configuration files are only bundled if either the --configPlugin or the --bundleConfigAsCjs options are used. The configuration is bundled to an ES module unless the --bundleConfigAsCjs option is used. In all other cases, configuration is now loaded using Node's native mechanisms (#​4574 and #​4621)
    • The properties attached to some errors have been changed so that there are fewer different possible properties with consistent types (#​4579)
    • Some errors have been replaced by others (ILLEGAL_NAMESPACE_REASSIGNMENT -> ILLEGAL_REASSIGNMENT, NON_EXISTENT_EXPORT -> MISSING_EXPORT) (#​4579)
    • Files in rollup/dist/* can only be required using their file extension (#​4581)
    • The loadConfigFile helper now has a named export of the same name instead of a default export (#​4581)
    • When using the API and sourcemaps, sourcemap comments are contained in the emitted files and sourcemaps are emitted as regular assets (#​4605)
    • Watch mode no longer uses Node's EventEmitter but a custom implementation that awaits Promises returned from event handlers (#​4609)
    • Assets may only be deduplicated with previously emitted assets if their source is a string (#​4644)
    • By default, Rollup will keep external dynamic imports as import(…) in commonjs output unless output.dynamicImportInCjs is set to false (#​4647)
    Changes to Rollup Options
    • As functions passed to output.banner/footer/intro/outro are now called per-chunk, they should be careful to avoid performance-heavy operations (#​4543)
    • entryFileNames/chunkFileNames functions now longer have access to the rendered module information via modules, only to a list of included moduleIds (#​4543)
    • The path of a module is no longer prepended to the corresponding chunk when preserving modules (#​4565)
    • When preserving modules, the [name] placeholder (as well as the chunkInfo.name property when using a function) now includes the relative path of the chunk as well as optionally the file extension if the extension is not one of .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, or .cts (#​4565)
    • The [ext], [extName] and [assetExtName] placeholders are no longer supported when preserving modules (#​4565)
    • The perf option no longer collects timings for the asynchronous part of plugin hooks as the readings were wildly inaccurate and very misleading, and timings are adapted to the new hashing algorithm (#​4566)
    • Change the default value of makeAbsoluteExternalsRelative to "ifRelativeSource" so that absolute external imports will no longer become relative imports in the output, while relative external imports will still be renormalized (#​4567)
    • Change the default for output.generatedCode.reservedNamesAsProps to no longer quote properties like default by default (#​4568)
    • Change the default for preserveEntrySignatures to "exports-only" so that by default, empty facades for entry chunks are no longer created (#​4576)
    • Change the default for output.interop to "default" to better align with NodeJS interop (#​4611)
    • Change the default for output.esModule to "if-default-prop", which only adds __esModule when the default export would be a property (#​4611)
    • Change the default for output.systemNullSetters to true, which requires at least SystemJS 6.3.3 (#​4649)
    Plugin API Changes
    • Plugins that add/change/remove imports or exports in renderChunk should make sure to update ChunkInfo.imports/importedBindings/exports accordingly (#​4543)
    • The order of plugin hooks when generating output has changed (#​4543)
    • Chunk information passed to renderChunk now contains names with hash placeholders instead of final names, which will be replaced when used in the returned code or ChunkInfo.imports/importedBindings/exports (#​4543 and #​4631)
    • Hooks defined in output plugins will now run after hooks defined in input plugins (used to be the other way around) (#​3846)
    Features
    • Functions passed to output.banner/footer/intro/outro are now called per-chunk with some chunk information (#​4543)
    • Plugins can access the entire chunk graph via an additional parameter in renderChunk (#​4543)
    • Chunk hashes only depend on the actual content of the chunk and are otherwise stable against things like renamed/moved source files or changed module resolution order (#​4543)
    • The length of generated file hashes can be customized both globally and per-chunk (#​4543)
    • When preserving modules, the regular entryFileNames logic is used and the path is included in the [name] property. This finally gives full control over file names when preserving modules (#​4565)
    • output.entryFileNames now also supports the [hash] placeholder when preserving modules (#​4565)
    • The perf option will now collect (synchronous) timings for all plugin hooks, not just a small selection (#​4566)
    • All errors thrown by Rollup have name: RollupError now to make clearer that those are custom error types (#​4579)
    • Error properties that reference modules (such as id and ids) will now always contain the full ids. Only the error message will use shortened ids (#​4579)
    • Errors that are thrown in response to other errors (e.g. parse errors thrown by acorn) will now use the standardized cause property to reference the original error (#​4579)
    • If sourcemaps are enabled, files will contain the appropriate sourcemap comment in generateBundle and sourcemap files are available as regular assets (#​4605)
    • Returning a Promise from an event handler attached to a RollupWatcher instance will make Rollup wait for the Promise to resolve (#​4609)
    • There is a new value "compat" for output.interop that is similar to "auto" but uses duck-typing to determine if there is a default export (#​4611)
    • There is a new value "if-default-prop" for esModule that only adds an __esModule marker to the bundle if there is a default export that is rendered as a property (#​4611)
    • Rollup can statically resolve checks for foo[Symbol.toStringTag] to "Module" if foo is a namespace (#​4611)
    • There is a new CLI option --bundleConfigAsCjs which will force the configuration to be bundled to CommonJS (#​4621)
    • Import assertions for external imports that are present in the input files will be retained in ESM output (#​4646)
    • Rollup will warn when a module is imported with conflicting import assertions (#​4646)
    • Plugins can add, remove or change import assertions when resolving ids (#​4646)
    • The output.externalImportAssertions option allows to turn off emission of import assertions (#​4646)
    • Use output.dynamicImportInCjs to control if dynamic imports are emitted as import(…) or wrapped require(…) when generating commonjs output (#​4647)
    Bug Fixes
    • Chunk hashes take changes in renderChunk, e.g. minification, into account (#​4543)
    • Hashes of referenced assets are properly reflected in the chunk hash (#​4543)
    • No longer warn about implicitly using default export mode to not tempt users to switch to named export mode and break Node compatibility (#​4624)
    • Avoid performance issues when emitting thousands of assets (#​4644)
    Pull Requests

    v2.79.1

    Compare Source

    2022-09-22

    Bug Fixes
    • Avoid massive performance degradation when creating thousands of chunks (#​4643)
    Pull Requests

    v2.79.0

    Compare Source

    2022-08-31

    Features
    • Add amd.forceJsExtensionForImports to enforce using .js extensions for relative AMD imports (#​4607)
    Pull Requests

    v2.78.1

    Compare Source

    2022-08-19

    Bug Fixes
    • Avoid inferring "arguments" as name for a default export placeholder variable (#​4613)
    Pull Requests

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • docs: readme: add await

    docs: readme: add await

    Since import is a promise.

    https://github.com/humanwhocodes/module-importer/blob/3cffc3ea6238f08be710a406908b1eeb1d230c9f/src/module-importer.cjs#L76-L79

    opened by coderaiser 0
  • chore(deps): update dependency eslint to v8.28.0

    chore(deps): update dependency eslint to v8.28.0

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | eslint (source) | 8.22.0 -> 8.28.0 | age | adoption | passing | confidence |


    Release Notes

    eslint/eslint

    v8.28.0

    Compare Source

    Features

    • 63bce44 feat: add ignoreClassFieldInitialValues option to no-magic-numbers (#​16539) (Milos Djermanovic)
    • 8385ecd feat: multiline properties in rule key-spacing with option align (#​16532) (Francesco Trotta)
    • a4e89db feat: no-obj-calls support Intl (#​16543) (Sosuke Suzuki)

    Bug Fixes

    • c50ae4f fix: Ensure that dot files are found with globs. (#​16550) (Nicholas C. Zakas)
    • 9432b67 fix: throw error for first unmatched pattern (#​16533) (Milos Djermanovic)
    • e76c382 fix: allow * 1 when followed by / in no-implicit-coercion (#​16522) (Milos Djermanovic)

    Documentation

    Chores

    v8.27.0

    Compare Source

    Features

    • f14587c feat: new no-new-native-nonconstructor rule (#​16368) (Sosuke Suzuki)
    • 978799b feat: add new rule no-empty-static-block (#​16325) (Sosuke Suzuki)
    • 69216ee feat: no-empty suggest to add comment in empty BlockStatement (#​16470) (Nitin Kumar)
    • 319f0a5 feat: use context.languageOptions.ecmaVersion in core rules (#​16458) (Milos Djermanovic)

    Bug Fixes

    • c3ce521 fix: Ensure unmatched glob patterns throw an error (#​16462) (Nicholas C. Zakas)
    • 886a038 fix: handle files with unspecified path in getRulesMetaForResults (#​16437) (Francesco Trotta)

    Documentation

    • ce93b42 docs: Stylelint property-no-unknown (#​16497) (Nick Schonning)
    • d2cecb4 docs: Stylelint declaration-block-no-shorthand-property-overrides (#​16498) (Nick Schonning)
    • 0a92805 docs: stylelint color-hex-case (#​16496) (Nick Schonning)
    • 74a5af4 docs: fix stylelint error (#​16491) (Milos Djermanovic)
    • 324db1a docs: explicit stylelint color related rules (#​16465) (Nick Schonning)
    • 94dc4f1 docs: use Stylelint for HTML files (#​16468) (Nick Schonning)
    • cc6128d docs: enable stylelint declaration-block-no-duplicate-properties (#​16466) (Nick Schonning)
    • d03a8bf docs: Add heading to justification explanation (#​16430) (Maritaria)
    • 8a15968 docs: add Stylelint configuration and cleanup (#​16379) (Nick Schonning)
    • 9b0a469 docs: note commit messages don't support scope (#​16435) (Andy Edwards)
    • 1581405 docs: improve context.getScope() docs (#​16417) (Ben Perlmutter)
    • b797149 docs: update formatters template (#​16454) (Milos Djermanovic)
    • 5ac4de9 docs: fix link to formatters on the Core Concepts page (#​16455) (Vladislav)
    • 33313ef docs: core-concepts: fix link to semi rule (#​16453) (coderaiser)

    v8.26.0

    Compare Source

    Features

    • 4715787 feat: check Object.create() in getter-return (#​16420) (Yuki Hirasawa)
    • 28d1902 feat: no-implicit-globals supports exported block comment (#​16343) (Sosuke Suzuki)
    • e940be7 feat: Use ESLINT_USE_FLAT_CONFIG environment variable for flat config (#​16356) (Tomer Aberbach)
    • dd0c58f feat: Swap out Globby for custom globbing solution. (#​16369) (Nicholas C. Zakas)

    Bug Fixes

    • df77409 fix: use baseConfig constructor option in FlatESLint (#​16432) (Milos Djermanovic)
    • 33668ee fix: Ensure that glob patterns are matched correctly. (#​16449) (Nicholas C. Zakas)
    • 740b208 fix: ignore messages without a ruleId in getRulesMetaForResults (#​16409) (Francesco Trotta)
    • 8f9759e fix: --ignore-pattern in flat config mode should be relative to cwd (#​16425) (Milos Djermanovic)
    • 325ad37 fix: make getRulesMetaForResults return a plain object in trivial case (#​16438) (Francesco Trotta)
    • a2810bc fix: Ensure that directories can be unignored. (#​16436) (Nicholas C. Zakas)
    • 35916ad fix: Ensure unignore and reignore work correctly in flat config. (#​16422) (Nicholas C. Zakas)

    Documentation

    • 651649b docs: Core concepts page (#​16399) (Ben Perlmutter)
    • 631cf72 docs: note --ignore-path not supported with flat config (#​16434) (Andy Edwards)
    • 1692840 docs: fix syntax in examples for new config files (#​16427) (Milos Djermanovic)
    • d336cfc docs: Document extending plugin with new config (#​16394) (Ben Perlmutter)

    Chores

    v8.25.0

    Compare Source

    Features

    • 173e820 feat: Pass --max-warnings value to formatters (#​16348) (Brandon Mills)
    • 6964cb1 feat: remove support for ignore files in FlatESLint (#​16355) (Milos Djermanovic)
    • 1cc4b3a feat: id-length counts graphemes instead of code units (#​16321) (Sosuke Suzuki)

    Documentation

    Chores

    v8.24.0

    Compare Source

    Features

    • 1729f9e feat: account for sourceType: "commonjs" in the strict rule (#​16308) (Milos Djermanovic)
    • b0d72c9 feat: add rule logical-assignment-operators (#​16102) (fnx)
    • f02bcd9 feat: array-callback-return support findLast and findLastIndex (#​16314) (Sosuke Suzuki)

    Documentation

    Chores

    v8.23.1

    Compare Source

    Bug Fixes

    • b719893 fix: Upgrade eslintrc to stop redefining plugins (#​16297) (Brandon Mills)
    • 734b54e fix: improve autofix for the prefer-const rule (#​16292) (Nitin Kumar)
    • 6a923ff fix: Ensure that glob patterns are normalized (#​16287) (Nicholas C. Zakas)
    • c6900f8 fix: Ensure globbing doesn't include subdirectories (#​16272) (Nicholas C. Zakas)

    Documentation

    • 16cba3f docs: fix mobile double tap issue (#​16293) (Sam Chen)
    • e098b5f docs: keyboard control to search results (#​16222) (Shanmughapriyan S)
    • 1b5b2a7 docs: add Consolas font and prioritize resource loading (#​16225) (Amaresh S M)
    • 1ae8236 docs: copy & use main package version in docs on release (#​16252) (Jugal Thakkar)
    • 279f0af docs: Improve id-denylist documentation (#​16223) (Mert Ciflikli)

    Chores

    v8.23.0

    Compare Source

    Features

    • 3e5839e feat: Enable eslint.config.js lookup from CLI (#​16235) (Nicholas C. Zakas)
    • 30b1a2d feat: add allowEmptyCase option to no-fallthrough rule (#​15887) (Amaresh S M)
    • 43f03aa feat: no-warning-comments support comments with decoration (#​16120) (Lachlan Hunt)

    Documentation

    Chores


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency typescript to v4.9.3

    chore(deps): update dependency typescript to v4.9.3

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | typescript (source) | 4.7.4 -> 4.9.3 | age | adoption | passing | confidence |


    Release Notes

    Microsoft/TypeScript

    v4.9.3: TypeScript 4.9

    Compare Source

    For release notes, check out the release announcement.

    Downloads are available on:

    Changes:

    See More

    This list of changes was auto generated.

    v4.8.4: TypeScript 4.8.4

    Compare Source

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    v4.8.3: TypeScript 4.8.3

    Compare Source

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    v4.8.2: TypeScript 4.8

    Compare Source

    For release notes, check out the release announcement.

    For the complete list of fixed issues, check out the

    Downloads are available on:


    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
  • chore(deps): update dependency rollup to v2.79.1

    chore(deps): update dependency rollup to v2.79.1

    Mend Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | rollup (source) | 2.78.0 -> 2.79.1 | age | adoption | passing | confidence |


    Release Notes

    rollup/rollup

    v2.79.1

    Compare Source

    2022-09-22

    Bug Fixes
    • Avoid massive performance degradation when creating thousands of chunks (#​4643)
    Pull Requests

    v2.79.0

    Compare Source

    2022-08-31

    Features
    • Add amd.forceJsExtensionForImports to enforce using .js extensions for relative AMD imports (#​4607)
    Pull Requests

    v2.78.1

    Compare Source

    2022-08-19

    Bug Fixes
    • Avoid inferring "arguments" as name for a default export placeholder variable (#​4613)
    Pull Requests

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

    Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v1.0.1)
Owner
Human Who Codes
Human Who Codes
Node.js loader for compiling ESM & TypeScript modules to CommonJS

cjs-loader Node.js require() hook to instantaneously transform ESM & TypeScript to CommonJS on demand using esbuild. Features Transforms ESM & TypeScr

esbuild kit 40 Dec 13, 2022
Minimal utility to convert to or from any timezone. Deno/Node/Browser. ESM/CommonJS.

minitz Features Convert dates between any timezone supported by the system. Parses ISO8601 time strings. MIT licensed, use the library any way you wan

Hexagon 14 Oct 10, 2022
Babel plugin and helper functions for interoperation between Node.js native ESM and Babel ESM

babel-plugin-node-cjs-interop and node-cjs-interop: fix the default import interoperability issue in Node.js The problem to solve Consider the followi

Masaki Hara 15 Nov 6, 2022
📦 🍣 Zero-config JS bundler for ESM, CommonJS, and .d.ts outputs

pkgroll Write your code in ESM & TypeScript and bundle it to get ESM, CommonJS, and type declaration outputs with a single command! Features Zero conf

hiroki osame 153 Dec 23, 2022
📦 🍣 Zero-config JS bundler for ESM, CommonJS, and .d.ts outputs. (Forked from pkgroll)

?? ?? puild (A fork of pkgroll) Write your code in ESM & TypeScript and bundle it to get ESM, CommonJS, and type declaration outputs with a single com

ʀᴀʏ 6 Sep 6, 2022
utility library for promise, support both commonjs and ESM

promising-utils A utility library for promise, supports both commonjs and ESM npm install promising-utils --save yarn add promising-utils wait Used wh

Qiang Li 4 Oct 18, 2022
Recursively publish ESM packages as CommonJS!

Commonify.js For us who are still relying on CommonJS, or using Electron which does not support ESM. ?? See also build-electron I made this tool that

Mikael Finstad 31 Dec 29, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Node.js ESM loader for chaining multiple custom loaders.

ESMultiloader Node.js ESM loader for chaining multiple custom loaders. Fast and lightweight No configuration required, but configurable if needed Usag

jhmaster2000 2 Sep 12, 2022
Node.js loader for compiling TypeScript modules to ESM

esm-loader Node.js import hook to instantaneously transform TypeScript to ESM on demand using esbuild. Features Transforms TypeScript to ESM on demand

esbuild kit 90 Jan 4, 2023
Lightweight universal Cloudflare API client library for Node.js, Browser, and CF Workers

Cloudflare API Client Lightweight universal HTTP client for Cloudflare API based on Fetch API that works in Node.js, browser, and CF Workers environme

Kriasoft 15 Nov 13, 2022
CLI utility that parses argv, loads your specified file, and passes the parsed argv into your file's exported function. Supports ESM/TypeScript/etc out of the box.

cleffa CLI tool that: Parses argv into an object (of command-line flags) and an array of positional arguments Loads a function from the specified file

Lily Scott 9 Mar 6, 2022
testing rollup dist for cjs/esm

std.module.format version 0.1.3 std.module.format Overview TLDR Avoid Default Exports and Prefer Named Exports Context Summary Decision ECMAScript Mod

sam bacha 5 Dec 11, 2022
An Android universal reader for BiliBiliSpace, Twitter, RSS and more.

Collector An Android universal information stream reader aiming to replace RSS. Features No login, No tracking, All unique identifiers are removed fro

null 26 Jan 1, 2023
Uniform, Unlimited, Universal and Unbelievable Annotation Toolbox

特性 ?? 本项目包含@label-u/annotation、@label-u/components、@label-u/utils及@label-u/web等4个工程。 ?? 采用rollup esbuild插件及vite编译,让开发者上高速,开发效率更高 ?? 采用lerna进行多工程管理。 ??

OpenDataLab 16 Dec 23, 2022
Just a Universal Mineflayer Bot (Opensourced)

❓ What is JUMBO? JUMBO (Just a Universal Mineflayer Bot - Opensourced) is a Minecraft robot made using Mineflayer package and its addons. Supports MC

Hedgie 16 Dec 9, 2022
Universal interface for web3 wallets

Universal interface for web3 wallets

WeBill.io 76 Dec 31, 2022