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

@sonnyt/just

v0.0.6

Published

Zero config TypeScript build and development toolkit.

Downloads

23

Readme

Just GitHub tag (latest SemVer pre-release) GitHub

Zero config TypeScript build and development toolkit.

Features

  • Fast SWC compiler
  • TypeScript type check support
  • Live reload support
  • .env file support
  • Path alias support
  • Typescript script runner
  • REPL support

Install

# Locally in your project.
npm install -D @sonnyt/just

# Or globally
npm install -g @sonnyt/just

Usage

To start a dev server in the root of your project just (😉) run:

just dev

To build:

just build

Commands

Build

just build [options] [files]

Compiles the application for production deployment.

Arguments

  • files - glob file path to compile. If not present, includes from config.json is used.

Options |Option|Default|Description| |:--|:--|:--| |--transpile-only|off|disables type checking| |--out-dir <outDir>|compilerOptions.outDir|output folder for all emitted files| |--no-color|off|disables output color| |--debug|false|enables debug logging| |-c, --config <config>|default|path to typescript configuration file|

Dev

just dev [options] [entry]

Starts the application in development mode. Watches for any file changes and live reloads the server.

Arguments

  • entry - server entry path to start. If not present, main from package.json is used.

Options |Option|Default|Description| |:--|:--|:--| |-p, --port <port>|null|server port used in process.env.PORT| |--type-check|false|enables type checking| |--no-color|off|disables output color| |--debug|false|enables debug logging| |-c, --config <config>|default|path to typescript configuration file|

Run

just run [options] <command> [args...]

Runs .ts file scripts.

Arguments

  • <command> - script/command to run.
  • [args...] - arguments passed to the script/command.

Options |Option|Default|Description| |:--|:--|:--| |--no-color|off|disables output color| |--debug|false|enables debug logging| |-c, --config <config>|default|path to typescript configuration file|

Programmatic

You can require Just runner programmatically two ways:

Import Just as early as possible in your application code.

require('@sonnyt/just/register');

Or you can use the --require (-r) command line option to preload Just. By doing this, you do not need to require and load Just in your application code.

node -r @sonnyt/just/register myscript.ts

Please note that runner does not support type checking.

Default Config File

Just automatically finds and loads tsconfig.json or jsconfig.json. By default, this search is performed relative to the entrypoint script. If neither file is found nor the file is not provided as an argument. Just falls back to using default settings shown below.

{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ES2021",
    "moduleResolution": "Node",
    "inlineSourceMap": true,
    "strict": true,
    "baseUrl": "./",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "importHelpers": true,
    "outDir": "dist",
    "paths": {}
  },
  "include": [
    "./"
  ],
  "exclude": [
    "node_modules"
  ]
}

Environment Variables

When using the dev or run commands. Just automatically finds and loads environment variables from a .env file into process.env. By default, this search is performed relative to the entrypoint script.

Path Alias

Based on the paths configuration, Just replaces all alias paths with relative paths after typescript compilation.

FAQ

Does Just work with ES Modules?

Currently, Just only supports building ES Module files.

What's the REPL use case?

Just REPL enables you to execute TypeScript files on Node.js directly without precompiling. It serves as a replacement for ts-node.

Does Just compile alias paths?

Out of the box, Just supports build and runtime path aliases. All output file alias imports are replaced with relative paths.

What happens to my non-JavaScript/TypeScript files?

If your source directory includes non-compilable files (i.e., JSON, SVG, etc.), Just automatically copies them into your output directory.

How can I help?

If you would like to contribute, please see the issues labeled as help-wanted.

Roadmap

  • Build watch option #7
  • Init option - copy over the default config file to the working directory #5
  • TypeScript ESLint support #6
  • Prettier support
  • REPL ES module support
  • ~~jsconfig.json support~~
  • .swcrc support