Parse.com REST API Client for Node.js
This `node-parse-api` library serves as a Node.js client for the Parse.com REST API, offering functionalities like data insertion, user management (login, registration), file uploads, and querying objects. At version 0.3.8, it reflects an early period of Node.js and the Parse.com platform. A critical aspect of this package is its tight coupling to the original Parse.com hosted service, which was officially shut down in January 2017. Consequently, while the package itself is available, its primary utility for connecting to `api.parse.com` is obsolete. There is no indication of active development or a release cadence, and it is likely abandoned, primarily existing as historical reference for developers who might have used the original Parse.com platform. Its design predates modern JavaScript module systems, relying exclusively on CommonJS.
Common errors
-
Error: connect ECONNREFUSED
cause The application is attempting to connect to `api.parse.com` which is no longer active, or a misconfigured self-hosted Parse Server is unreachable.fixThis library is designed for the defunct Parse.com service. If attempting to connect to a self-hosted Parse Server, this specific library might not be suitable or require internal modifications (e.g., `Parse._api_host`). Consider using the official `@parse/node` or `parse` npm packages instead. -
TypeError: app.insert is not a function
cause The `Parse` object was not correctly instantiated as a client instance, or the imported `Parse` object is not the expected constructor.fixEnsure you are instantiating the `Parse` client correctly after requiring it: `const { Parse } = require('node-parse-api'); const app = new Parse(APP_ID, MASTER_KEY);` -
Cannot find module 'node-parse-api'
cause The package has not been installed or is not correctly linked in the project.fixRun `npm install node-parse-api` to add the package to your project dependencies.
Warnings
- breaking The Parse.com hosted service, which this library directly targets (`api.parse.com`), was officially shut down on January 28, 2017. This package is **not functional** for its original purpose of connecting to the cloud-hosted Parse.com backend.
- gotcha This package is not actively maintained. It was last published almost a decade ago and targets very old Node.js runtimes (specified as `>= 0.4.0`). Using it with modern Node.js versions may lead to unexpected behavior, compatibility issues, or security vulnerabilities due to unpatched dependencies.
- gotcha The library explicitly uses CommonJS `require()` syntax. It does not natively support ES Modules (`import`) and attempting to use `import { Parse } from 'node-parse-api';` in an ESM-only context will result in a runtime error.
Install
-
npm install node-parse-api -
yarn add node-parse-api -
pnpm add node-parse-api
Imports
- Parse
import { Parse } from 'node-parse-api';const { Parse } = require('node-parse-api'); - ParseClient (instance)
const ParseClient = new require('node-parse-api').Parse(APP_ID, MASTER_KEY);const ParseClient = new Parse(APP_ID, MASTER_KEY);
Quickstart
const { Parse } = require('node-parse-api');
const APP_ID = process.env.PARSE_APP_ID ?? '';
const MASTER_KEY = process.env.PARSE_MASTER_KEY ?? '';
// Ensure environment variables are set or replace with actual values (not recommended for production)
if (!APP_ID || !MASTER_KEY) {
console.error('PARSE_APP_ID and PARSE_MASTER_KEY environment variables must be set.');
process.exit(1);
}
const app = new Parse(APP_ID, MASTER_KEY);
// Insert an object into a 'Foo' class
app.insert('Foo', { foo: 'bar', timestamp: new Date() }, function (err, response) {
if (err) {
console.error('Error inserting object:', err);
return;
}
console.log('Successfully inserted object:', response);
// A real application would typically have more operations here.
// Given Parse.com is shut down, this example is primarily illustrative.
});