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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@push.rocks/websetup

v3.0.20

Published

A library for setting up basic properties of a web page including meta tags, OpenGraph tags, JSON-LD structured data, with support for dynamic content.

Downloads

1,623

Readme

@push.rocks/websetup

setup basic page properties

Install

To install @push.rocks/websetup, you can use npm (Node Package Manager). Simply run the following command in your terminal:

npm install @push.rocks/websetup --save

This will download the package and add it to your project's node_modules directory, as well as save it as a dependency in your project's package.json file.

Usage

To use @push.rocks/websetup in your web applications to set up basic page properties efficiently, follow these steps and guidelines. The examples are provided using ECMAScript modules (ESM) syntax along with TypeScript for type safety and better tooling support.

First, ensure you import the necessary modules from @push.rocks/websetup in your TypeScript files:

// Import the main class `WebSetup` from the package
import { WebSetup } from '@push.rocks/websetup';

Basic Setup

Begin by creating an instance of WebSetup with basic page properties. This example demonstrates setting up page title, description, and canonical URL.

// Create a WebSetup instance with basic meta information
const webSetup = new WebSetup({
  metaObject: {
    title: 'Example Page Title',
    description: 'This is a description of the example page.',
    canonicalDomain: 'https://www.example.com',
  },
});

// Wait for the setup to complete
webSetup.readyPromise.then(() => {
  console.log('WebSetup is ready.');
});

Advanced Usage

Setting up Structured Data with JSON-LD

Structured data is crucial for SEO and enhancing your page's appearance in search results. @push.rocks/websetup allows you to easily setup company, product, or news article information using JSON-LD.

// Define company information
const companyInfo = {
  name: 'Example Company Inc.',
  contact: {
    website: 'https://www.example.com',
    logoUrl: 'https://www.example.com/logo.png',
    phone: '+1234567890',
    facebookUrl: 'https://facebook.com/example',
    twitterUrl: 'https://twitter.com/example',
  },
};

// Pass the company information to WebSetup
const webSetupWithCompanyInfo = new WebSetup({
  metaObject: {
    title: 'Example Page Title',
    ldCompany: companyInfo,
  },
});

// For products
const productInfo = {
  name: 'Example Product',
  description: 'A detailed description of the example product.',
  os: 'Web',
  category: 'SaaS',
  logoLink: 'https://www.example.com/product-logo.png',
};

// Pass the product information along with company information for structured data setup
const webSetupWithProductInfo = new WebSetup({
  metaObject: {
    title: 'Product Page Title',
    ldProduct: productInfo,
    ldCompany: companyInfo,
  },
});

// Wait for setup completion
webSetupWithProductInfo.readyPromise.then(() => {
  console.log('WebSetup with product info is ready.');
});

Dynamic Subpage Levels

You might have a web application where different "subpages" or sections require different meta tags (e.g., title, description). You can dynamically set these properties without recreating the WebSetup instance.

// Assume `webSetup` is an existing instance of WebSetup

// Define meta object for a new subpage
const subPageMeta = {
  title: 'Subpage Title',
  description: 'Description for the subpage.',
};

// Dynamically set the subpage level
webSetup.setSubLevel(subPageMeta).then(() => {
  console.log('Subpage meta tags are set.');
});

// Revert to base level when leaving the subpage
webSetup.revertToBaseLevel();

This approach allows developers to manage site-wide and subpage-specific properties efficiently, enhancing user experience and SEO.

Handling Ready for Server-Side Rendering (SSR)

For projects using server-side rendering (SSR), it is essential to signal when the page is ready to be captured. This is especially useful when using SSR solutions like smartSSR that wait for a signal from the client.

// Inform that the page is ready for SSR capture
webSetup.informReadyForSmartssr();

Note: This feature should be used if you have smartssrWaitForReadySignal option enabled during the WebSetup initialization.

Conclusion

The @push.rocks/websetup package provides a streamlined way to manage basic page properties, structured data using JSON-LD for SEO, and dynamic settings for different page sections or states. By following the examples above and integrating @push.rocks/websetup into your projects, you can improve your web application's SEO, maintainability, and developer experience.

License and Legal Information

This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the license file within this repository.

Please note: The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.

Trademarks

This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.

Company Information

Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany

For any legal inquiries or if you require further information, please contact us via email at [email protected].

By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.