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

moleculer-ra-data-provider

v1.6.1

Published

Moleculer.services data provider for react-admin

Readme

moleculer-ra-data-provider

Build Status FOSSA Status NPM NPM Downloads

A Moleculer compatible data provider for React Admin.

Convert on-the-fly data exchanged with Moleculer micro-services in order to use them directly in your React-Admin components like List, Edit, Create ....

Features

Supported actions:

  • CREATE
  • GET_ONE
  • GET_LIST
  • GET_MANY
  • GET_MANY_REFERENCE
  • UPDATE
  • UPDATE_MANY
  • DELETE
  • DELETE_MANY

Installation

# via npm
npm install moleculer-ra-data-provider

# OR via yarn
yarn add moleculer-ra-data-provider

Usage

Import this package, set the base url and pass it as the dataProvider to react-admin.

//in app.js
import React from "react";
import { Admin, Resource } from "react-admin";
import { ListGuesser } from 'react-admin'; // example

import moleculerDataProvider from 'moleculer-ra-data-provider';

const dataProvider = moleculerDataProvider('http://localhost:13000/api');

const App = () => (
  <Admin dashboard={Dashboard} dataProvider={dataProvider}>
    // example displaying a list received from http://localhost:3000/api/myusers 
    <Resource name="myusers"    list={ListGuesser} />
  </Admin>
);

export default App;

Option renameFields

You can rename a field name in a resources.

This is usefull when a moleculer service return both an _id and an id.

Example 1: the field id moleculer service 'trades' is renamed into uuid (leaving the place for a copy of _id)

//in app.js
const dataProvider = moleculerDataProvider('http://localhost:13000/api', {renameFields: {"trades": {"id":"uuid"} }});

In this case, data provided (by moleculer) {_id:1, id:"A"} becomes (in react-admin) {id:1, uuid:"A"}

In case of create/update, the reverse operation is done: react-admin {id:1, uuid:"B"} becomes {_id:1, id:"B"}

Option idFields

You can specify the _id field name (duplicated as id for react-admin) for some/all resources

Example 1: the moleculer service 'orders' is using uuid instead of _id

//in app.js
const dataProvider = moleculerDataProvider('http://localhost:13000/api', {idFields: {"orders": "uuid" }});

Example 2: the moleculer service 'orders' is using uuid instead of _id, others are using myId

//in app.js
const dataProvider = moleculerDataProvider('http://localhost:13000/api', {idFields: {"orders": "uuid", "DEFAULT": "myId"  }});

Example 3: Combined renameFields and idFields: trades.id2 becomes trades.uuid, trades._id becomes trades.id2, in all other resources, use id2 as db key (moleculer default is _id)

//in app.js
const dataProvider = moleculerDataProvider('http://localhost:13000/api', {renameFields: {"trades": {"id2":"uuid"} }, idFields: {"trades": "id2", "DEFAULT": "id1"  }});

Licence

MIT

FOSSA Status