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

@selfage/cli

v5.0.1

Published

Basic CLI to buid, run and format TypeScript code.

Downloads

32

Readme

@seflage/cli

Install

npm install @selfage/cli

Overview

Written in TypeScript and compiled to ES6 with inline source map & source. See @selfage/tsconfig for full compiler options. Provides an opinionated and basic CLI for developing apps in TypeScript. See sections below for each sub-command and see commander if you are not sure about CLI syntax.

Compile

If you specified incremental: true in your tsconfig.json, tsBuildInfoFile will not be respected and will be overriden as <file>.tsbuildinfo.

Respect merging base tsconfig via extends.

$ selfage compile -h
Usage: selfage compile|cpl [options] <file>

Compile a single TypeScript source file while respecting compilerOptions in tsconfig.json. Its file ext can be neglected and is always fixed as .ts.

Options:
  -c, --tsconfig-file <file>    The file path to tsconfig.json. If not provided, it will try to look for it at the current working directory.
  -s, --extra-files <files...>  Extra files to be compiled together with and before the source file.
  -h, --help                    display help for command

Clean

$ selfage clean -h
Usage: selfage clean [options]

Clean all ignored files by .gitignore, except node_modules/.

Options:
  -h, --help  display help for command

Run

$ selfage run -h
Usage: selfage run [options] <file> [pass-through-args...]

Compile and run the specified file under Node environment. Its file ext can be neglected and is always fixed as .ts. "--" is needed in between <file> and pass through arguments.

Options:
  -c, --tsconfig-file <file>  The file path to tsconfig.json. If not provided, it will try to look for it at the current
                              working directory.
  -h, --help                  display help for command

Run forever

$ selfage runForever -h
Usage: selfage runForever|frun [options] <file> [pass-through-args...]

Run the already compiled file under Node environment while auto restart when it crashes/ends. Its file ext can be neglected and is always fixed as .js. "--" is needed in between <file> and pass through arguments.

Options:
  -h, --help  display help for command

It's a minimalist version that does nothing more than auto-restarting crashed/ended Node program.

Format

On top of prettier, add support to sort imports in a deterministic way but will not keep comments between import statements in place. Please leave comments on top of all import statements.

$ selfage format -h
Usage: selfage format|fmt [options] <file>

Format the specified file. The file type is always fixed as '.ts'.

Options:
  --dry-run   Print the formatted content instead of overwriting the file.
  -h, --help  display help for command

L10n lint

TBD: Detailed explanation of L10n pattern.

$ selfage lln -h
Usage: main lintL10n|lln [options] <baseDir>

Checks localization pattern compliance, such as file structure, and missing, duplicated or redundant keys.

Options:
  -h, --help  display help for command

API access

Please check out the corresponding .d.ts file for function signatures for each sub-command.

compile -> import { compile } from "@selfage/cli/build/compiler";

clean -> import { clean } from "@selfage/cli/build/cleaner";

run -> import { run } from "@selfage/cli/run/runner";

runForever -> import { run } from "@selfage/cli/run/forever_runner";

format -> import { format } from "@selfage/cli/formatter";

lintL10n -> import { lintL10n } from "./l10n_linter";

E.g., you could import { compile } from '@selfage/cli/build/compiler'; and call await compile('some_source', 'tsconfig.json') to compile a single file.