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

@smithy/core

v2.5.3

Published

[![NPM version](https://img.shields.io/npm/v/@smithy/core/latest.svg)](https://www.npmjs.com/package/@smithy/core) [![NPM downloads](https://img.shields.io/npm/dm/@smithy/core.svg)](https://www.npmjs.com/package/@smithy/core)

Downloads

60,892,782

Readme

@smithy/core

NPM version NPM downloads

An internal package. You probably shouldn't use this package, at least directly.

This package provides common or core functionality for generic Smithy clients.

You do not need to explicitly install this package, since it will be installed during code generation if used.

Development of @smithy/core submodules

Core submodules are organized for distribution via the package.json exports field.

exports is supported by default by the latest Node.js, webpack, and esbuild. For react-native, it can be enabled via instructions found at reactnative.dev/blog, but we also provide a compatibility redirect.

Think of @smithy/core as a mono-package within the monorepo. It preserves the benefits of modularization, for example to optimize Node.js initialization speed, while making it easier to have a consistent version of core dependencies, reducing package sprawl when installing a Smithy runtime client.

Guide for submodules

  • Each index.ts file corresponding to the pattern ./src/submodules/<MODULE_NAME>/index.ts will be published as a separate dist-cjs bundled submodule index using the Inliner.js build script.
  • create a folder as ./src/submodules/<SUBMODULE> including an index.ts file and a README.md file.
    • The linter will throw an error on missing submodule metadata in package.json and the various tsconfig.json files, but it will automatically fix them if possible.
  • a submodule is equivalent to a standalone @smithy/<pkg> package in that importing it in Node.js will resolve a separate bundle.
  • submodules may not relatively import files from other submodules. Instead, directly use the @scope/pkg/submodule name as the import.
    • The linter will check for this and throw an error.
  • To the extent possible, correctly declaring submodule metadata is validated by the linter in @smithy/core. The linter runs during yarn build and also as yarn lint.

When should I create an @smithy/core/submodule vs. @smithy/new-package?

Keep in mind that the core package is installed by all downstream clients.

If the component functionality is upstream of multiple clients, it is a good candidate for a core submodule. For example, if middleware-retry had been written after the support for submodules was added, it would have been a submodule.

If the component's functionality is downstream of a client (rare), or only expected to be used by a very small subset of clients, it could be written as a standalone package.