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

node-ext

v1.0.8

Published

`node-ext` is an enhanced version of `node`. It defaults with support of `typescript`, `ES5 Module`.

Downloads

26

Readme

About node-ext

node-ext is an enhanced version of node. It defaults with support of typescript, ES5 Module.

Install

# install
npm install -g node-ext # this will link /usr/local/bin/nx to node-ext/bin/nx, if not linked previous.
nx --help

# run
echo 'console.log("hello world")' >test.ts
nx test.ts

# edit test.ts with vscode in a prepared directory
nx test.ts --code

Special instructions

If you need to install third-party libraries, i.e. libraries not shipped with node-ext, you can specify them in the file with special instructions prefixed with //!node-ext, the syntax is:

//!node-ext: install a@v b@v c@v
//!node-ext: use name DIR

Example:

//!node-ext: install fs [email protected]
//!node-ext: use my-lib ~/my-lib

Usage examples

Watch

nx --dev-watch dev.go --dev-watch-cmd '$NX_CMD func-to-ast|$NX_CMD ast-to-definitions' gen.ts

Why not using npx

npx is problemtic with npm install in a temp directory.So we prefer to not use npx, rather just use node.

How it works?

It autoamatically generate package.json,tsconfig.json,webpackage.config.js on the fly for any running configuration.

Typescript issues

cannot find @node-ext?

The reason is that you have a tsconfig.json in your src directory, so the ts language server use that instead of the one generated by nx.

You can work this out by temporariy renaming that tsconfig.json to tsconfig.json.bak when you edit in the temp directory opened by nx --code.

install @types/node

npm install --save-dev @types/node

For Maintenance of This Project

Development

The project has a webpack.config.js, which pack run.ts into bin/run.js. bin/run.js is ran by invoking nx, and nx is linked to /usr/local/bin/nx.

When running nx with given file /path/to/x.ts, nx will create a temporary directory called $TMP/path/to, where $TMP refers to /tmp on Linux, and other temp dir defined by specific OS. And it will link the $TMP/path/to/src to /path/to.

In the generated webpack.config.js, @node-ext will resolved to NPM_ROOT/node-ext/lib, where NPM_ROOT is the path to global npm node_modules root.

The script npm run install-local generates bin/run.js and copy that to NPM_ROOT/node-ext/bin/run.js, thus install-local installs local modifications of run.ts to global.

If you added some file in lib, you can run npm run install-local-lib.

Publish

Change version in package.json,and run npm publish.

You can publish before committing changes to github.