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

atropa-repl-autoload

v2022.11.17

Published

Autoloads a file into the Node REPL on start then passes control to the user.

Downloads

5

Readme

Autoloads a file into the Node REPL on start then passes control to the user.

Install it on node from npm

npm install atropa-repl-autoload

Overview

Takes three args, a file and encoding, exactly like fs.readFileSync. So yes, the encoding is optional and defaults to utf8. The third argument is an optional options object which corresponds to the options for repl.start

On the command line the third option will require quoting and escaping per your shell's instructions and then you'll need to JSON.parse it before passing it off. It may be easier to simply specify the options arg in your js file or leaving the argument unspecified and accepting the defaults.

It's easy to use

With or Without Commandline Parameters

This would be useful for code editors that allow you to launch external programs and pass the filename of the currently focused file. You would be able to load the file you're editing into the REPL and try things out right away.

In notepad++ the command would look something like node path\to\thisScript.js "$(FULL_CURRENT_PATH)" if you were to name the following example thisScript.js and have node in your path.

This would also be useful if you wanted to load the same file into the repl all the time. Say, for instance, if you were working on a library.

var replAutoload = require('atropa-repl-autoload');
var file = process.argv[2];
var encoding = process.argv[3];
var options = process.argv[4];

// uncomment one of the following lines depending
// on how you want to launch the REPL.


// to allow specifying all options on the command line

// replAutoload(file, encoding, JSON.parse(options));
// node thisScript.js scriptToLoad.js encodingOfScriptToLoad options


// to allow only file and encoding to be specified and, setting the same options
// every time you run the repl.

// replAutoload(file, encoding, { "ignoreUndefined" : "true" });
// node thisScript.js scriptToLoad.js encodingOfScriptToLoad


// to preload the same file every time the repl is started replace
// test.js with the name and location of the file you want to preload.

// replAutoload('test.js', 'utf8', { "ignoreUndefined" : "true" });
// node thisScript.js

Intellisense Support and Documentation

Visual studio intellisense support is available in docs/vsdoc/OpenLayersAll.js Full documentation may be found at http://matthewkastor.github.io/atropa-replAutoload