
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
The full api documentation is available here. To get started we suggest you read the overview. If you already know what you're looking for we suggest the reference material on what is available on the instance of d2.
For more information on how the models work the model module documentation is helpful reference material. For other questions see the FAQ.
Start with adding d2 to your project:
yarn add d2
or npm install d2
After installing you will be able to import the library into your project by using the files in the lib
folder:
// Using ES2015 imports
import d2 from 'd2';
// Using CommonJS imports
var d2 = require('d2');
To be able to use d2 you will first need to initialise the library. This is required to let the library know where it should load its data from (e.g. the schemas, currentUser, authorities). The schemas are the definitions of the data model as used in DHIS2.
To do this you can provide d2 with a baseUrl
(if you don't provide any the default of ../api
will be used):
import { init } from 'd2';
init({ baseUrl: 'http://apps.dhis2.org/dev/api' })
.then(d2 => {
//Your d2 is initialised and ready to use.
});
d2.models.user.list()
.then(userCollection => {
userCollection.forEach(user => console.log(user.name)));
});
That's it! See the documentation referenced above for further information.
The issue tracker can be found in DHIS2 JIRA under the LIBS project.
Deep links:
FAQs
Javascript library for DHIS2
The npm package d2 receives a total of 7,649 weekly downloads. As such, d2 popularity was classified as popular.
We found that d2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.