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

@inlasningstjanst/dtmn_player

v1.0.17

Published

Student player for Inläsningstjänst DTMN (Digital Teaching Material Narrating)

Readme

NPM Version

Purpose

To produce a ready-to-use React component that can play the sentences in a given article, and mark the sentences in the DOM.

Playback controls are not included in the component, but examples of how to implement them are.

Usage

Installation

yarn add @inlasningstjanst/dtmn_player

Arguments

apiUrl: (string) Required. The url to the ILT API, serving the audio files

token: (string) Required. The authorization JWT token provided by ILT.

url: (string) Optional. The url to requested article. Defaults to window.location, but this will only work in a production environment where there is only one article per page.

backgroundColor: (string) Optional. The background color of marked text

color: (string) Optional. The color of marked text

onAudioEnded: (func) Optional. Callback when audio playback ends

onSentencePlay: (func) Optional. Callback when audio playback starts/resumes to play

playToSentence: (number) Optional. If provided, the player will play until selected number of sentence

playbackSpeed: (float) Optional. The playback speed. Recommended value is between 0.8 and 2.0. Default is 1.0.

domContainerQuery: (string) Optional. If provided, the player will look for the sentences to mark in the first DOM element matching provided query. Defaults to container query set in the article. Important that this is set properly if there are more than one instance of the same article in a page.

Public methods

To call methods on the component, use the ref argument as demonstrated below.

play(): Will start playing recorded sentences

pause(): Will pause any currently playing sentence

reset(): Will stop any currently playing sentence reset playback to first sentence

nextSentence(): Will play the next sentence

prevSentence(): Will play the previous sentence

playSentence(x): Will jump to and play sentence x (where x is the order within the article)

isAvailable(): (bool) Returns true if the specified article is found, published and ready to play.

Example

import IltDtmnPlayer from "@inlasningstjanst/dtmn_player";
<IltDtmnPlayer
	ref={player => {
		this.player = player;
	}}
	backgroundColor="#808000"
	color="#FFFF00"
	onAudioEnded={this.onAudioEnded}
        onSentencePlay={this.onSentencePlay}
        playToSentence={10}
	playbackSpeed={1.0}
	domContainerQuery="#articles #article-12345"
	apiUrl="[URL TO ILT API]"
	url="[URL TO CURRENT ARTICLE]"
	token="[JWT TOKEN OBTAINED FROM ILT]"
/>;

For a more detailed example, please see the provided files in the /examples folder

Available Scripts

In the project directory, you can run:

yarn transpile

Builds the player component into the /dist folder, ready to be imported into another project as a IltDtmnPlayer component.

yarn start

Runs the example app in development mode. Open http://localhost:3001 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

yarn test

Runs all tests in the project.

yarn build

Builds the example app to the examples/build folder.

Distribution

The transpiled component is ready to use by a React application. To publish the packaged component to NPM, run:

npm publish --access public

Authorization

The transpiled component expects a JWT token that will be forwarded and verified by the API. This token determines if the user has access to the requested article or not.

See this ILT confluence article for more info about how to obtain a valid token: https://publisher-auth-dev.inlasningstjanst.se/docs/