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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sonardigital/changelog

v1.0.2

Published

react context-based changelog management system for managing and displaying version history, release notes, and platform-specific updates

Downloads

270

Readme

Changelog Package

A React context-based changelog management system for managing and displaying version history, release notes, and platform-specific updates.

Installation

npm install @sonardigital/changelog
# or
yarn add @sonardigital/changelog

Usage

1. Define your Changelog Data

Create a list of changelog entries.

import { Changelog } from '@sonardigital/changelog';

const changelogData: Changelog[] = [
  {
    version: '1.0.0',
    date: '2023-10-27',
    changes: [
      { type: 'feature', description: 'Initial release' },
      { type: 'fix', description: 'Fixed login bug' },
    ],
    platform: ['ios', 'android', 'web'],
  },
  // ... more entries
];

2. Wrap your app with ChangelogProvider

Initialize the provider with your changelog data using the useChangelog hook.

import React from 'react';
import { ChangelogProvider, useChangelog } from '@sonardigital/changelog';

const App = () => {
  const changelogMethods = useChangelog({ 
    changelog: changelogData,
    platforms: ['ios', 'android', 'web'] // optional, defaults to all platforms
  });

  return (
    <ChangelogProvider methods={changelogMethods}>
      {/* Your app code */}
    </ChangelogProvider>
  );
};

3. Access Changelog Data

Use the useChangelogContext hook to access the changelog data and helper methods anywhere in your app.

import React from 'react';
import { useChangelogContext } from '@sonardigital/changelog';

const ChangelogScreen = () => {
  const { changelog, currentVersion, totalReleases, platforms } = useChangelogContext();

  return (
    <div>
      <h2>current version: {currentVersion}</h2>
      <p>total releases: {totalReleases}</p>
      <p>platforms: {platforms.join(', ')}</p>
      {changelog.map((entry) => (
        <div key={entry.version}>
          <h3>{entry.version} - {entry.date}</h3>
          {entry.changes.map((change, index) => (
            <p key={index}>- [{change.type}] {change.description}</p>
          ))}
        </div>
      ))}
    </div>
  );
};

API Reference

useChangelog

Hook to initialize the changelog context state.

Parameters:

  • changelog: Changelog[] - Array of changelog entries.
  • platforms: Platform[] - Optional array of platforms to filter changelog entries. Defaults to ['ios', 'android', 'web'].

Returns:

  • ChangelogContextType object containing state and methods.

ChangelogProvider

Provider component to pass down changelog data.

Props:

  • methods: ChangelogContextType - The object returned by useChangelog.
  • children: React.ReactNode

useChangelogContext

Hook to consume the changelog context. Returns ChangelogContextType with the following properties:

  • changelog: Changelog[] - Filtered array of changelog entries based on selected platforms.
  • currentVersion: string - The version of the first changelog entry (latest version).
  • totalReleases: number - Total number of changelog entries.
  • platforms: Platform[] - Array of platforms used for filtering.

Types

Changelog

interface Changelog {
  version: string;
  date: string;
  changes: Change[];
  platform: Platform[];
}

Change

interface Change {
  type: 'feature' | 'fix' | 'improvement' | 'breaking';
  description: string;
}

Platform

type Platform = 'ios' | 'android' | 'web';