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

squak

v3.3.1

Published

Setup and build modern Web Servers in TypeScript.

Downloads

73

Readme

squak

Setup and build modern Web Servers in TypeScript.

  • ESLint, Prettier
  • TypeScript Configuration
  • Watcher
  • Production Standalone Build
  • All just by installing it...

Installation

Existing TypeScript Project

npm install squak --save-dev

This will automatically adapt your package.json and create the necessary configuration files.

New Project

// Bootstrap the default template in the current directory.
npm init --yes now squak
// Additional options:
npm init --yes now squak [./my-web-server] [template = 'default' | 'empty' | 'full' | 'graphql' | 'serverless']

The default template includes a basic express server. Here are the templates.

Usage

npm start

Run the compiler and the node server in watch mode. Use this for development.

npm run production | npx squak production

Build the project, prune devDependencies and then run the server.

npm test (if tests found) | npx squak test

Run tests with jest.

npx squak lint

Lint all files in the project with ESLint and format them with Prettier.

npx squak build

Build the project by compiling the TypeScript source files.

Configuration

This plugin provides an extensive set of configurations aimed at working in various environments. However the configurations can easily be extended by adding a squak property to your package.json.

{
    "name": "my-web-server",
    "squak": {
        // What's the name of the entry file, automatically adds [src/]?index.ts file if available.
        entry: 'my-server.ts',
        entry: ['rest-server.ts', 'graphql-server.ts'],
        // Output directory for compiled files, default 'dist'.
        output: 'node-server',
        // Folder where tests are located, default 'test', false to disable tests.
        test: 'spec',
        // Overrides for the TypeScript configuration.
        tsconfig: {
            compilerOptions: {
                moduleResolution: 'NodeNext'
            }
        },
        // Additional entries to be added to gitignore, default none.
        // Can also be entered directly into .gitignore file.
        gitignore: [],
    }
}

Changes for configuration files will be applied each time before a script is run. tsconfig.json is best configured through the package.json -> squak property. ESLint and jest can directly be adapted in their respective fields in package.json which will be added upon installation.