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

@hint/utils

v7.0.24

Published

hint tools

Downloads

77,458

Readme

Utils (@hint/utils)

Set of tools for hint.

Installation

To install the package, you need to run:

npm install @hint/utils

Tools

The tools included in this package are:

  • asyncTry: Wrap an async function, returning null if the evaluation throws and exception.
  • get-hints-from-extends: Returns all hints in a configuration, including hints inside the extended configurations.

compat

  • getFriendlyName: Get the friendly name of a browser from an id.
  • getUnsupported: Get browsers without support for CSS or HTML features.
  • getUnsupportedDetails: Get browsers without support with details on when support was added or removed.
  • isSupported: Query MDN for support of CSS or HTML features.

configStore

  • get: Get the value from the config store.
  • set: Set a value in the config store.

contentType

  • determineMediaTypeBasedOnFileExtension: Get a mime-type associated with the specified file extension.
  • determineMediaTypeBasedOnFileName: Get a mime-type associated with the specified filename.
  • determineMediaTypeForScript: Check if the provided mime-type is a recognized mime-type for JavaScript, returning the recommended mime-type if so, null otherwise.
  • getContentTypeData: Try to determine the correct mime-type for a response.
  • getFileExtension: Try to determine a resource's file extension.
  • getType: Returns the group to which the mediaType belongs to. E.g.: image, font, script, css, html, manifest, xml or unknown.
  • isTextMediaType: Check if a mime-type represents a text-based resource.

logger

  • error: Cover for console.error.
  • log: Cover for console.log.
  • warn: Cover for console.warn.

misc

  • askQuestion: Asks a y/n question to the user defaulting to Yes.
  • delay: Convenience wrapper to add a delay using promises.
  • mergeEnvWithOptions: Merges any webhint_ prefixed environment variable available with the given options object.

npm

  • installPackages: Install the given packages.
  • search: Searches all the packages in npm given searchTerm.
  • getOfficialPackages: Get core packages from npm.
  • getUnnoficialPackages: Get external packages from npm.

packages

  • findNodeModulesRoot: Find the node_modules folder where hint is installed as a dependency or returns the hint node_modules folder if not.
  • findPackageRoot: Searches for the first folder that contains the fileToFind going up the tree.
  • isOfficial: Returns if the hint that is going to be created is an official.
  • loadPackage: Returns the package found in the given pathString or an exception if no package is found.
  • hasMultipleResources: Returns true if a hint package is a multi-hint.
  • isFullPackageName: Returns true if the name is a full package name.
  • loadHintPackage: Returns the package hint.
  • loadResource: Returns a resource if it exists.
  • requirePackage: Require a package, compatible with webpack.