ECMAScript module utilities.
mlly
is a set of ECMAScript module (ESM) utilities. It exposes several tools to bridge the gap between
developer experience and the current state of ECMAScript modules.
This package is ESM only.
In Node.js (version 18+) with yarn:
yarn add @flex-development/mlly
See Git - Protocols | Yarn for details regarding installing from Git.
In Deno with esm.sh
:
import { resolveModule } from 'https://esm.sh/@flex-development/mlly'
In browsers with esm.sh
:
<script type="module">
import { resolveModule } from 'https://esm.sh/@flex-development/mlly'
</script>
import {
canParseUrl,
cwd,
defaultConditions,
defaultExtensions,
defaultMainFields,
extensionFormatMap,
formats,
getSource,
isAbsoluteSpecifier,
isArrayIndex,
isBareSpecifier,
isDirectory,
isFile,
isImportsSubpath,
isRelativeSpecifier,
legacyMainResolve,
lookupPackageScope,
moduleResolve,
packageExportsResolve,
packageImportsExportsResolve,
packageImportsResolve,
packageResolve,
packageSelfResolve,
packageTargetResolve,
patternKeyCompare,
patternMatch,
readPackageJson,
resolveAlias,
resolveModule,
resolver,
root,
toRelativeSpecifier,
toUrl
} from '@flex-development/mlly'
This package exports the following identifiers:
canParseUrl
cwd
defaultConditions
defaultExtensions
defaultMainFields
extensionFormatMap
formats
getSource
isAbsoluteSpecifier
isArrayIndex
isBareSpecifier
isDirectory
isFile
isImportsSubpath
isRelativeSpecifier
lookupPackageScope
patternKeyCompare
patternMatch
readPackageJson
resolveAlias
resolveModule
resolver
legacyMainResolve
moduleResolve
packageExportsResolve
packageImportsExportsResolve
packageImportsResolve
packageResolve
packageSelfResolve
packageTargetResolve
root
toRelativeSpecifier
toUrl
There is no default export.
This package is fully typed with TypeScript.
Aliases
FileSystem
MainFieldMap
ModuleFormatMap
ResolveAliasOptions
ResolveModuleOptions
ProtocolMap
Stats
See CONTRIBUTING.md
.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.