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

@ts4nfdi/terminology-service-suite-js

v6.4.5

Published

This project includes a widget component library derived from the semantic lookup service SemLookP. The Terminology Service is a repository for biomedical resources that aims to provide a single point of access to the latest ontology and terminology versi

Readme

Usage

Demo projects:

A minimal JavaScript app using the NPM JavaScript package
A minimal HTML app using the IIFE

Projects, which use the widgets in production:

TS4NFDI Service Portal

Usage of the NPM package

  1. Install the package
npm install @ts4nfdi/terminology-service-suite
  1. Include the code in your app.js
import * as ts4nfdiWidgets from '@ts4nfdi/terminology-service-suite';

document.addEventListener('DOMContentLoaded', () => {
    const container = document.getElementById('autocomplete-widget-container');

    if (container) {
        ts4nfdiWidgets.createAutocomplete(
            {
                api: "https://semanticlookup.zbmed.de/api/",
                selectionChangedEvent:(() => {
                    console.log("selectionChangedEvent")
                }),
            },
            container
        );
        console.log("TS4NFDI AutocompleteWidget rendered.");
    } else {
        console.error("Autocomplete widget container not found!");
    }
});
  1. Add to your index.html body:
<div id="autocomplete-widget-container" style="width: 500px; margin: 20px;"></div>
<script src="../dist/bundle.js"></script>
  1. Add to your index.html head:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ts4nfdi/[email protected]/dist/terminology-service-suite-js.css">
  1. Build and open in browser

Usage of the IIFE in a plain HTML without any bundler

  1. Include in your .html (use the latest version):
<div id="autocomplete" class="module-output-container">
        <p>Loading module content...</p>
    </div>

<script src="https://cdn.jsdelivr.net/npm/@ts4nfdi/[email protected]/dist/index.iife.js"></script>

<script type="text/javascript">
    const autocomplete = document.getElementById('autocomplete');

    if (typeof ts4nfdiWidgets !== 'undefined' && typeof ts4nfdiWidgets.createAutocomplete === 'function') {
        ts4nfdiWidgets.createAutocomplete(
            {
                api: "https://semanticlookup.zbmed.de/api/",
                selectionChangedEvent:((props) => {
                    console.log("autocomplete")
                }),
                allowCustomTerms:true,
                singleSelection: true,

            },
            autocomplete
        );
        console.log("createAutocomplete function called successfully.");
    } else {
        // Display an error if the module or function is not found
        console.error("Error: ts4nfdiWidgets module or createAutocomplete function not found.");
        if (autocomplete) {
            autocomplete.innerHTML = '<p>Error: Module not loaded or createAutocomplete function missing. Check console for details.</p>';
        }
    }
</script>

code snippets are provided in the Show code drop-down in the Storybook.

Usage of older versions

Versions older than 5.0 are published at GitHub.

To use the widgets in an HTML file, you can either download the modules or use links and embed them in the appropriate tags in the head of the file. You can also include a link to an Elastic UI stylesheet. The plainJS module and CSS files can be found here.

<head>
    <link rel="stylesheet" href="./css/terminology-service-suite.css/">
    <script type="text/javascript" src="./js/terminology-service-suite.js"></script>
</head>

OR link files directly from GitHub:

<head>
    <link rel="stylesheet" href="https://ts4nfdi.github.io/terminology-service-suite/js-modules/2.0.1/terminology-service-suite.min.css">
    <script type="text/javascript" src="https://ts4nfdi.github.io/terminology-service-suite/js-modules/2.0.1/terminology-service-suite.min.js"></script>
</head>

An empty container with an id must be created. This container can then be referenced in a script tag where the widget can now be rendered using the appropriate function. Here's a sample snippet:

<body>
    <div id="datacontent_widget"></div>
    <script>
        let widgetContainer = document.getElementById('datacontent_widget');
        window['ts4nfdiWidgets'].createDataContent(
            {
                api: "https://www.ebi.ac.uk/ols4/api/",
            },
            widgetContainer
        );
    </script>
</body>

Development instructions

https://github.com/ts4nfdi/terminology-service-suite/wiki/Development-instructions