npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

babel-plugin-fully-specified

v1.3.0

Published

Babel Plugin to transform your code to include the mandatory file extensions so your output gets fully-specified imports.

Downloads

160,175

Readme

babel-plugin-fully-specified

Babel Plugin to transform your code to include the mandatory file extensions so your output gets fully-specified imports.

For who is this?

  • 📚 Component Library authors
  • 📦 NPM Package authors
  • 🛠 Tooling authors

🍀 Basically for everyone who uses "type": "module" in their package.json – 🌈 but don't want to rewrite all their import paths to include e.g. /index.js or extension at all.

It will transform like this:

- import { Thing } from '/path'
+ import { Thing } from '/path/index.js'

NB: Dynamic imports are currently not support!

Install

npm install babel-plugin-fully-specified
# or
yarn add babel-plugin-fully-specified

… and add it to your Babel Plugins .babelrc (babel.config.js):

{
  "plugins": [
+    "babel-plugin-fully-specified"
  ]
}

Plugin Options

As of now, no options are available.

More details

ESM requires with the Mandatory file extensions, that all imports includes its file extension. Traditionally, its very common to omit it, especially when it comes to /index imports.

✨ Now, this is something the author of a package has to take care of – not you as a web page/app developer.

... failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

If you see this 👆 – ask the author of a package to make their build pipeline fully specified, by e.g. include babel-plugin-fully-specified.

This mono-repo will contain certain tools/packages to help you transform existing code during build.

- import { Thing } from '/path'
+ import { Thing } from '/path/index.js'

Contribution

Right now, only a Babel exists – but an ESLint Plugin would be nice to have as well.