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 🙏

© 2024 – Pkg Stats / Ryan Hefner

moralis-v1

v1.13.0

Published

The Moralis JavaScript SDK

Downloads

34,108

Readme

Note: This is the v1 version of the Moralis JS SDK, to support bugfixes. For the latest version, see https://github.com/MoralisWeb3/Moralis-JS-SDK

For more information on Moralis and its features, see the website, the JavaScript guide, the Cloud Code guide or Web3 Reference.

Getting Started

The easiest way to integrate the Moralis SDK into your JavaScript project is through the npm module. However, if you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/moralis-v1/dist/moralis.js, and the minified production version is at https://unpkg.com/moralis-v1/dist/moralis.min.js.

Webpack v5 support

There are a lot of breaking changes in Webpack v5. Set up your project to work with Moralis JS SDK:

configuring Webpack v5

We highly recommend you to use the stable 4.0.3 version of Webpack. If you want to use Moralis on your project with Webpack v5 you need to add the fallback to your webpack.config.js file:

module.exports = {
    resolve: {
        fallback: {
            assert: require.resolve('assert'),
            crypto: require.resolve('crypto-browserify'),
            http: require.resolve('stream-http'),
            https: require.resolve('https-browserify'),
            os: require.resolve('os-browserify/browser'),
            stream: require.resolve('stream-browserify'),
        },
    },
};

Using Moralis on Different Platforms

The JavaScript ecosystem is wide and incorporates a large number of platforms and execution environments. To handle this, the Moralis npm module contains special versions of the SDK tailored to use in Node.js and React Native environments. Not all features make sense in all environments, so using the appropriate package will ensure that items like local storage, user sessions, and HTTP requests use appropriate dependencies. For server side rendered applications, you may set the SERVER_RENDERING variable to prevent warnings at runtime.

To use the npm modules for a browser based application, include it as you normally would:

const Moralis = require('moralis-v1');
// ES6 Minimized
import Moralis from 'moralis-v1/dist/moralis.min.js';

For server-side applications or Node.js command line tools, include 'moralis-v1/node':

// In a node.js environment
const Moralis = require('moralis-v1/node');

For React Native applications, include 'moralis-v1/react-native.js':

// In a React Native application
const Moralis = require('moralis-v1/react-native.js');

// On React Native >= 0.50 and Moralis >= 1.11.0, set the Async
const AsyncStorage = require('react-native').AsyncStorage;
Moralis.setAsyncStorage(AsyncStorage);

Typescript support

Typescript types are supported out-of-the box. The types are defined in /types. These are updated with every release.