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

repl.js

v2.3.7

Published

Node.js REPL with promise support & CLI module requiring

Downloads

42

Readme

repl.js license|mit npm|repl.js

Node.js REPL with promise support & CLI module requiring.

This module is a drop-in replacement for node std repl. Can be used as shell & via API.

features

on-start requiring

Specify modules (with optional aliases) you want to be loaded into REPL onstart.

$ repl.js path lodash Promise=bluebird ./file.js file=./other_file.js

Here:

  • std module path will be loaded as path
  • node_modules lodash will be loaded as lodash
  • node_modules bluebird will be loaded as Promise
  • local file ./file.js will be loaded as file
  • local file ./other_file.js will be loaded as file and will overwrite previously loaded file

execute & enter interactive

Supply script or filename to execute. After executing REPL will be started with script's results.

# execute script and inspect its results in interactive mode
$ repl.js -e 'var x = 1;'

# execute file
$ repl.js -f script.js

If you just want execute script and do not enter interactive mode (just like node do), you can pass -q option.

promises

When evaling returns promise, it will not be outputted in «raw view» (like { then: … }), instead REPL will await for its fulfilling.

robust require

All modules are resolved relatively to workdir which REPL was started, and not relatively to REPL source files. So you can start repl from your project's directory and retrieve modules you need with proper versions.

useful utils

In REPL some features are loaded automatically:

  • Colored console via console (console-ultimate).
    • Take a moment to look through console-ultimate's features. It has support for hi-res timers, better stack traces, tables, grouping and neat coloring by default.
  • Colors via colors (cli-color).
  • Common-use utilities from aux.js, functional stuff (aux.js).
    • Many of functions are inserted directly in global, use dir() to inspect them.
  • Partially-applicated log function via logpart.
  • Function's signatures and source code via signature (alias sg) and sourceCode (alias src).
  • dir function for navigating objects (enums, not-enums, own, from prototype chain).

clean environment

If you do not want utilities to be loaded into REPL, pass --clean option.

$ repl.js --clean

note for windows users

Use repljs executable instead of repl.js in your cmd.

license

MIT. © Strider, 2013 — 2017.