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

seo-jsonld

v1.3.5

Published

Generate jsonLd for your webpage. Structure is provided for several types of jsonLd. Improve SEO from these favoured structures.

Downloads

13

Readme

SEO JSONLD

Search engines works hard to understand the content of a page. We can help them by providing explicit clues about the meaning of a page by including structured data on the page. Structured data is a standardized format for providing information about a page and classifying the page content.

Search Engine Support

Rules

Google Search Topics Covered

Install

npm i seo-jsonld --save

Options for methods

  • Artical

    • Method Name: artical
    • Input Format: ArticalStructuredData | Array<ArticalStructuredData>
  • Breadcrumb

    • Method Name: breadCrump
    • Input Format: BreadcrumbStructureData | Array<BreadcrumbStructureData>
  • Course List

    • Method Name: course
    • Input Format: CourseStructureData | Array<CourseStructureData>
  • COVID-19 announcement

    • Method Name: covid19
    • Input Format: Covid19StructuredData | Array<Covid19StructuredData>
  • Dataset

    • Method Name: dataSet
    • Input Format: DatasetStructureData | Array<DatasetStructureData>
  • Education Q&A

    • Method Name: educationalQA
    • Input Format: EducationalQAStructuredData | Array<EducationalQAStructuredData>
  • Event

    • Method Name: event
    • Input Format: EventStructuredData | Array<EventStructuredData>
  • Fact Check

    • Method Name: factCheck
    • Input Format: FactCheckStructuredData | Array<FactCheckStructuredData>
  • FAQ

    • Method Name: faq
    • Input Format: FAQStructuredData | Array<FAQStructuredData>
  • Job Posting

    • Method Name: jobPosting
    • Input Format: JobPostingStructureData | Array<JobPostingStructureData>
  • Learning Video

    • Method Name: learningVideo
    • Input Format: LearningVideoStructuredData | Array<LearningVideoStructuredData>
  • Local business

    • Method Name: localBusiness
    • Input Format: LocalBusinessStructuredData | Array<LocalBusinessStructuredData>
  • Logo

    • Method Name: logo
    • Input Format: LogoStructuredData | Array<LogoStructuredData>
  • Movie

    • Method Name: movie
    • Input Format: Array<MovieStructuredData>
  • Review

    • Method Name: review
    • Input Format: ReviewStructuredData | Array<ReviewStructuredData>
  • Sitelinks Search

    • Method Name: searchBox
    • Input Format: SearchBoxStructuredData
  • Software App

    • Method Name: softwareApplication
    • Input Format: SoftwareApplicationStructureData | Array<SoftwareApplicationStructureData>
  • Video

    • Method Name: video
    • Input Format: VideoStructureData | Array<VideoStructureData>

Example of usage

  import { SeoJsonLd, appendToHeadElement } from 'seo-jsonld';
  import { StructureDataType } from 'seo-jsonld/dist/types/types';

  export class JsonLdConverter {

    private jsonLd = new SeoJsonLd();

    loadData(data: any, type: StructureDataType): void {
      const map = {
        "artical": this.jsonLd.artical,
        "course": this.jsonLd.course,
        "covid-19": this.jsonLd.covid19,
        "dataset": this.jsonLd.dataSet,
        "educational-qa": this.jsonLd.educationalQA,
        "event": this.jsonLd.event,
        "fact-check": this.jsonLd.factCheck,
        "faq": this.jsonLd.faq,
        "job-posting": this.jsonLd.jobPosting,
        "learning-video": this.jsonLd.learningVideo,
        "local-business": this.jsonLd.localBusiness,
        "logo": this.jsonLd.logo,
        "movie": this.jsonLd.movie,
        "review": this.jsonLd.review,
        "search-box": this.jsonLd.searchBox,
        "software-application": this.jsonLd.softwareApplication,
        "video": this.jsonLd.video
      };
      const result = map[type](data);
      // To attach to the document open below line
      // appendToHeadElement({ data: result, document, type });
    }

  }