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

@thi3rry/ohmystrapi

v1.0.0-alpha

Published

A lib based on OhMyFetch to consume strapi API

Readme

ohmystrapi

Lib based on ohmyfetch to consume strapi API

Install

npm i ohmystrapi

Usage

Basic init

import ohMyStrapi from 'ohmystrapi';

const strapi = ohMyStrapi.useStrapi({
    baseUrl: 'http://localhost:1337',
});

You can fetch content with :

const articlesResponse = await strapi.createFetch()('/articles')

BUT! You can also use the ohmystrapi content-manager plugin

Plugins

ContentManager

import ohMyStrapi from 'ohmystrapi';
import {useSingleTypeEntityApi} from 'ohmystrapi';

strapi.use(ohMyStrapi.useEntityApi('articles'));
strapi.use(useSingleTypeEntityApi('settings'));

// get articles
const articles = await strapi.articles.find();
articles.forEach(article => console.log(article.title));

// get articles with "strapi" in content 
const articles = await strapi.articles.search({content: {$contains: 'strapi'}});
articles.data.forEach(article => console.log(article.title));

// get the first article with title contains strapi
const article = await strapi.articles.searchOne({title: {$contains: 'strapi'}});


// Toogle an `online` boolean on an single entity 'settings'
const {data: {online}} = await strapi.settings.find();
await strapi.settings.createOrUpdate({online: !online});
EntityMapper

You can pass as a second argument of the useEntityApi a callback that will be used to map every entity returns by find/findOne/search/searchOne etc...

// Put all attributes next to the id of the entity
strapi.use(useEntityApi('articles', (obj) => ({id: obj.id, ...obj.attributes})));

Auth user

import ohMyStrapi from 'ohmystrapi';

strapi.use(ohMyStrapi.useUsersPermissionsApi());

// Login a user
await strapi.user.login({identifier: '[email protected]', password: 'password'});
const personnalData = await strapi.user.me();

Tests

It uses vitest to create test and fetch a local strapi. You need to start a local strapi instance to run tests