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

coffee-ssr

v1.0.1

Published

CLI tool for handling with SSR for angular coffee projects

Downloads

7

Readme

Coffee-SSR CLI

A CLI tool to facilitate the setup, configuration, and cleanup of Server-Side Rendering (SSR) for your Angular projects.

Prerequisites

  • Node.js: Version 18 or higher is required.

    Note: It's recommended to download any stable version above 8.11.1 from Node.js official website.

Installing Dependencies

To set up your project dependencies, navigate to the root directory of your project and run:

npm install

This command installs all the necessary packages specified in your package.json file.

Running the Project

Serving the Application

To serve the application and watch for changes, use the following command:

npm run serve

This command starts the development server, which serves your application and watches for changes in the source files. Whenever you make changes, the server will automatically reload.

Starting the Application

To run the application, use:

npm run start

This command starts your application using Node.js. Ensure that any necessary build steps have been completed beforehand.

Building the Application

To build the application for production, use:

npm run build

This command compiles your TypeScript code, bundles it, and outputs it to the dist directory. It optimizes the build for performance and smaller bundle sizes.

Installing the CLI Tool Globally

To install your CLI tool globally, run:

npm install -g .

This command installs your package globally on your system, allowing you to use the coffee-ssr command from anywhere.

Linking the Project for Development

Alternatively, for development purposes, you can link your project by running:

npm link

This command creates a symbolic link to your project folder in the global node_modules directory. It allows you to use the coffee-ssr command locally without installing it globally.

CLI Usage

Command Overview

After installing your CLI tool, you can use the following commands:

  • generate routes
  • init
  • clean

generate routes Command

This command extracts all routes from Angular routing modules within a specified directory.

Options
  • -d, --dir <directory>:
    Specifies the base directory to search for routing files.
    Default: src/app/components/public
Example

To generate routes from a custom directory:

coffee-ssr generate routes --dir src/app/custom-directory

init Command

This command initializes your Angular project for use with coffee-ssr.

Example

To initialize the project:

coffee-ssr init

This will create the necessary files (coffee-ssr.ts) and update your project configurations (like angular.json and package.json) to enable SSR with coffee-ssr.

clean Command

The clean command scans and cleans your project files to ensure compatibility with SSR. It performs the following actions:

  1. Cleans Angular Modules:

    • Removes any import statements for AngularSvgIconModule from all Angular modules.
    • Replaces any usage of AngularSvgIconModule with CoffeeSvgIconModule.
  2. Cleans HTML Files:

    • Replaces all <svg-icon> tags with <ngx-coffee-svg-icon>.
  3. Cleans Stylesheets:

    • Replaces any usage of .svg-icon with .ngx-coffee-svg-icon in all .scss and .css files.
Example

To clean your project for SSR compatibility:

coffee-ssr clean

This will automatically clean and modify the files to be SSR-compatible.