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

burecss

v1.0.1

Published

A lightweight, utility-first CSS framework for rapid UI development.

Downloads

3

Readme

Configuring a Repl

Every new repl comes with a .replit and a replit.nix file that let you configure your repl to do just about anything in any language!

replit.nix

Every new repl is now a Nix repl, which means you can install any package available on Nix, and support any number of languages in a single repl. You can search for a list of available packages here.

The replit.nix file should look something like the example below. The deps array specifies which Nix packages you would like to be available in your environment.

{ pkgs }: {
  deps = [
    pkgs.cowsay
  ];
}

Learn More About Nix

If you'd like to learn more about Nix, here are some great resources:

Written Guides

Video Guides

  • Nixology — A series of videos introducing Nix in a practical way
  • Taking the Nix pill — An introduction to what Nix is, how it works, and a walkthrough of publishing several new languages to Replit within an hour.
  • Nix: A Deep Dive — A deep dive on Nix: what Nix is, why you should use it, and how it works.

.replit

The .replit file allows you to configure many options for your repl, most basic of which is the run command.

Check out how to use the .replit file to configure a repl to enable Clojure:

.replit files follow the toml configuration format and look something like this:

# The command that is executed when the run button is clicked.
run = ["cargo", "run"]

# The default file opened in the editor.
entrypoint = "src/main.rs"

# Setting environment variables
[env]
FOO="foo"

# Packager configuration for the Universal Package Manager
# See https://github.com/replit/upm for supported languages.
[packager]
language = "rust"

  [packager.features]
  # Enables the package search sidebar
  packageSearch = true
  # Enabled package guessing
  guessImports = false

# Per language configuration: language.<lang name> 
[languages.rust]
# The glob pattern to match files for this programming language
pattern = "**/*.rs"

    # LSP configuration for code intelligence
    [languages.rust.languageServer]
    start = ["rust-analyzer"]

In the code above, the strings in the array assigned to run are executed in order in the shell whenever you hit the "Run" button.

The language configuration option helps the IDE understand how to provide features like packaging and code intelligence.

And the [languages.rust] pattern option is configured so that all files ending with .rs are treated as Rust files. The name is user-defined and doesn't have any special meaning, we could have used [languages.rs] instead.

We can now set up a language server specifically for Rust. Which is what we do with the next configuration option: [languages.rust.languageServer]. Language servers add smart features to your editor like code intelligence, go-to-definition, and documentation on hover.

Since repls are fully configurable, you're not limited to just one language. For example, you could install Clojure and its language server using replit.nix, add a [languages.clojure] configuration option to the above .replit file that matched all Clojure files and have code intelligence enabled for both languages in the same repl.

.replit reference

A Command can either be a string or a list of strings. If the Command is a string ("node index.js"), it will be executed via sh -c "<Command>". If the Command is a list of strings (["node", "index.js"]), it will be directly executed with the list of strings passed as arguments. When possible, it is preferred to pass a list of strings.

  • run
    • Type: Command
    • Description: The command to run the repl.
  • entrypoint
    • Type: string
    • Description: The name of the main file including the extension. This is the file that will be run, and shown by default when opening the editor.
  • onBoot
    • Type: Command
    • Description: The command that executes after your repl has booted.
  • compile
    • Type: Command
    • Description: The shell command to compile the repl before the run command. Only for compiled languages like C, C++, and Java.
  • audio
    • Type: boolean
    • Description: Enables system-wide audio for the repl when configured to true.
  • language
    • Type: string
    • Description: Reserved. During a GitHub import, this tells the workspace which language should be used when creating the repl. For new repls, this option will always be Nix, so this field should generally not be touched.
  • [env]
    • Description: Set environment variables. Don't put secrets here—use the Secrets tab in the left sidebar.
    • Example: VIRTUAL_ENV = "/home/runner/${REPL_SLUG}/venv"
  • interpreter
    • Description: Specifies the interpreter, which should be a compliant prybar binary.
    • command
      • Type: [string]
      • Description: This is the command that will be run to start the interpreter. It has higher precedence than the run command (i.e. interpreter command will run instead of the run command).
    • prompt
      • Type: [byte]
      • Description: This is the prompt used to detect running state, if unspecified it defaults to [0xEE, 0xA7].
  • [unitTest]
    • Enables unit testing to the repl.
    • language
      • Type: string
      • Description: The language you want the unit tests to run. Supported strings: java, python, and nodejs.
  • [packager]
    • Description: Package management configuration. Learn more about installing packages here.
    • afterInstall
      • Type: Command
      • Description: The command that is executed after a new package is installed.
    • ignoredPaths
      • Type: [string]
      • Description: List of paths to ignore while attempting to guess packages.
    • ignoredPackages
      • Type: [string]
      • Description: List of modules to never attempt to guess a package for, when installing packages.
    • language
      • Type: string
      • Description: Specifies the language to use for package operations. See available languages in the Universal Package Manager repository.
    • [packager.features]
      • Description: UPM features that are supported by the specified languages.
        • packageSearch
          • Type: Boolean
          • Description: When set to true, enables a package search panel in the sidebar.
        • guessImports
          • Type: Boolean
          • Description: When set to true, UPM will attempt to guess which packages need to be installed prior to running the repl.
  • [languages.<language name>]
    • Description: Per-language configuration. The language name has no special meaning other than to allow multiple languages to be configured at once.
    • pattern
      • Type: string
      • Description: A glob used to identify which files belong to this language configuration (**/*.js)
    • syntax
      • Type: string
      • Description: The language to use for syntax highlighting.
    • [languages.<language name>.languageServer]
      • Description: Configuration for setting up LSP for this language. This allows for code intelligence (autocomplete, underlined errors, etc...).
      • start
        • Type: Command
        • Description: The command used to start the LSP server for the specified language.
  • [nix]
    • Description: Where you specify a Nix channel.
    • channel
      • Type: string
      • Description: A nix channel id.
  • [debugger]
    • Description: Advanced users only. See field types & docstrings here, and in the advanced section below.

Example configurations

Beginner

LaTeX
Clojure

Advanced

Python
HTML, CSS, JS
Java
Node.js
C++