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

parse-rest-nodejs

v0.2.1

Published

Parse-server Rest API client for Node.js

Downloads

22

Readme

Parse Rest NodeJS

npm version

Install

npm install --save parse-rest-nodejs

How to Use

It's used as the basis of Parse Rest API.

Setup up process.env

// Recommend to use 'better-npm-run'.
process.env.SERVER_URL = "http://__host__/parse"
process.env.APP_ID = "__app_id__";
process.env.MASTER_KEY = "__master_key__";

Methods

'get', 'post', 'put', 'patch', 'del'

  • parameter: (url, data, headers, formData)

  • All methods are returned Promise.

parseRest.get('/classes/__className__').then((success) => {
  console.log(success);
}, (error) => {
  console.error(error);
});

Initialize

// es6
import ParseRest from 'parse-rest-nodejs';

// req is express request
const parseRest = new ParseRest(req);
// es5
var ParseRest = require('parse-rest-nodejs').default;

// req is express request
var parseRest = new ParseRest(req);

insert an object

parseRest.post('/classes/__className__', { ... })

insert a User

parseRest.post('/users', { ... })

insert with a Pointer

const user = { __type: 'Pointer', className: '_User', objectId }
parseRest.post('/classes/__className__', {..., user})

insert with GeoPoints

const location = { __type: 'GeoPoint', latitude, longitude };
parseRest.post('/classes/__className__', {..., location})

user login

parseRest.get('/login', { username, password }, { 'X-Parse-Revocable-Session': 1 })

me

  • It need to 'sessionToken' value in request header.
  • Alternatively, 'sessionToken' or 'user.sessionToken' value in request session is possible.
parseRest.get('/users/me')

insert a file

  • Use the property 'fileData'.
  • It is recommended to use multer.
// Express side
import express from 'express';
import multer from 'multer';

const app = express();
const upload = multer({ storage: multer.diskStorage({}) });
...
// file upload
app.post('/file/upload', upload.array('files'), function (req, res, next) {
  // console.log('upload complete / req.files :', req.files);
  return next();
});
...
// Action side
import fs from 'fs';

const _file = req.files[0];
const _fileInfo = { filename: _file.originalname, mimetype: _file.mimetype, size: _file.size, encoding: _file.encoding };
const fileData = { file: fs.createReadStream(_file.path), mimetype: _file.mimetype };

parseRest.post('/files/' + _file.filename, { fileData }).then((_fileResult) => {
  console.log('file result:', _fileResult);
  // Store where you need it
  parseRest.post('/classes/__className__', { ..._fileResult, ..._fileInfo })
});

get object

parseRest.get('/classes/Files', { objectId })

get list

parseRest.get('/classes/Files', { where: { ... }, limit, skip, order, ... })

get user

parseRest.get('/users', { objectId }, { useMasterKey: true })

get users

parseRest.get('/users', { where: { ... }, limit, skip, order, ... }, { useMasterKey: true })

count of objects

parseRest.get('/users', { limit: 0, count: 1 }, { useMasterKey: true });

update an object

parseRest.put('/classes/__className__/' + objectId, { ... })

delete an object

parseRest.del('/classes/__className__', { objectId })

delete user

parseRest.del('/users', { objectId }, { useMasterKey: true })

edit user

parseRest.put('/users/' + objectId, { ... }, { useMasterKey: true })

insert installation data

parseRest.post('/installations', { deviceToken, ... })

run cloud function

parseRest.post('/functions/__functionName__', { ... })