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

v_sitemap

v0.0.2

Published

Simple XML Sitemap Generator. Uses array of links and provides sitemapindex and urlset.

Downloads

1

Readme

v_sitemap

[🔥] WARNING : ALPHA DEVELOPMENT STATE [🔥]

00. Output Examples [from same array of items]:

v_sitemap Output Examples

1. Installing:

npm i v_sitemap --save

2. Using:

const v_sitemap = require('.');

// Some Random Array to Use for demonstration purpose.
const DEMO_DATA = [
    {
        name: 'Home',
        path: '/',
        lastmod: '2019-01-01',
        changefreq: 'yearly',
        priority: 0.4,
    },
    {
        name: 'About',
        path: '/about', 
        lastmod: '2020-01-01',
        changefreq: 'monthly',
        priority: 0.6,
    },{
        name: 'Contact',
        path: '/contact',
        lastmod: '2021-01-01',
        changefreq: 'daily',
        priority: 0.9,
    } 
];

const myMap = {
    data: DEMO_DATA, 
    index: true, 
    output: "DEMO_DATA.xml"
    };

v_sitemap(myMap);

2.1. Listing of sitemaps [sitemapindex]

That code will the produce this XML file:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://v-core9.com/</loc>
    </sitemap>
    <sitemap>
        <loc>https://v-core9.com/about</loc>
    </sitemap>
    <sitemap>
        <loc>https://v-core9.com/contact</loc>
    </sitemap>
</sitemapindex>

2.2. Single Sitemap [urlset]

By Changing option in "myMap" constant from "index == true" to false...like this:

const myMap = {
    data: DEMO_DATA, 
    index: false, 
    output: "DEMO_DATA.SMAP.xml"
};

v_sitemap(myMap);

and instead of sitemapindex it will produce this XML file

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://v-core9.com/</loc>
        <lastmod>2019-01-01</lastmod>
        <changefreq>yearly</changefreq>
        <priority>0.4</priority>
    </url>
    <url>
        <loc>https://v-core9.com/about</loc>
        <lastmod>2020-01-01</lastmod>
        <changefreq>monthly</changefreq>
        <priority>0.6</priority>
    </url>
    <url>
        <loc>https://v-core9.com/contact</loc>
        <lastmod>2021-01-01</lastmod>
        <changefreq>daily</changefreq>
        <priority>0.9</priority>
    </url>
</urlset>

2.3. Styled sitemap

By adding additional entry that is URL path to the file:

const myStyledMap = {
    data: DEMO_DATA,
    index: true,
    output: "sample.myStyledMap.xml",
    stylesheet:  "v-core9.com/style/XSL/sitemap.xsl"
};

v_sitemap(myStyledMap);

Sitemap Generation Options?

NOTICE:

For now just check _TEST_ Directory & "sample.run.js" file for more info