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

parse-utils

v2.12.1

Published

Parse JS SDK and Parse-Server utilities

Downloads

8

Readme

parse-utils

Parse JS SDK and Parse-Server utilities

Setup

This library is available on npm, install it with: npm install --save parse-utils

API

setParseLib

Set the Parse library to use (node/react-native).

Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | parseLib | Object | The Parse library instance. |

initializeParseSDK

Initialize the Parse SDK.

Category: Synchronous.

| Param | Type | | --- | --- | | serverURL | String | | appId | String | | masterKey | String |

createPointerFromId ⇒ ParseObject

Create a pointer to a Parse object given its id and the class name.

Returns: ParseObject - Pointer to the Parse object.
Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | className | String | The class name of the Parse object. | | objectId | String | The id of the Parse object. |

getObjectWithoutParseAttributes ⇒ Object

Strip off the Parse specific attributes from an Object.

Returns: Object - Object without the Parse specific attributes. Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | object | Object | Plain Javascript representation of a Parse Object. |

setField

Set the value of Parse object field (it mutates the object).

Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | parseObject | ParseObject | The Parse object with the field that must be set. | | fieldName | String | The name of the field. | | fieldValue | Number,Boolean,String,Array,ParseObject | The value of the field. |

setPointer

Set the value of Parse object field to a Parse pointer (it mutates the object).

Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | parseObject | ParseObject | The Parse object with the field that must be set. | | fieldName | String | The name of the field. | | pointerId | String | The objectId of the object pointed by the Parse pointer. | | pointerClassName | String | The class name of the pointed object. |

setArrayOfPointers

Set the value of Parse object field to an array of pointers (it mutates the object).

Category: Synchronous.

| Param | Type | Description | | --- | --- | --- | | parseObject | ParseObject | The object that with field that must be set. | | fieldName | String | The name of the field | | pointersIds | Array.<String> | The objectIds of the objects pointed by the Parse pointers. | | pointersClassName | String | The class name of the pointed objects. |

uploadFile ⇒ ParseObject

Upload a file.

Returns: ParseObject - The uploaded file.
Category: Asynchronous.

| Param | Type | | --- | --- | | fileName | String | | file | File |

getUserByEmail ⇒ ParseObject

Get a User given its email.

Returns: ParseObject - The User object.
Category: Asynchronous.

| Param | Type | | --- | --- | | userEmail | String |

getUserById ⇒ ParseObject

Get a User given its id.

Returns: ParseObject - The User object.
Category: Asynchronous.

| Param | Type | | --- | --- | | objectId | String |

getRoleByName ⇒ ParseObject

Get a Role given its name.

Returns: ParseObject - The Role object.
Category: Asynchronous.

| Param | Type | | --- | --- | | roleName | String |

findAll ⇒ Array.<ParseObject>

Execute a "find" Parse Query regardless of the limit imposed by Parse (which is 500).

Returns: Array.<ParseObject> - The array with the found Parse objects.
Category: Asynchronous.

| Param | Type | Description | | --- | --- | --- | | parseQuery | ParseQuery | The "find" Parse Query that will be executed. | | findOptions | Object | Options passed to the "find" function. |

saveAllInChunks ⇒ Array.<ParseObject>

Execute a "saveAll" Parse Query splitting in chunks the saveAll instructions.

Returns: Array.<ParseObject> - An array with the saved Parse Objects Category: Asynchronous.

| Param | Type | Description | | --- | --- | --- | | parseObjects | Array.<ParseObject> | The array of Parse object that will be saved. | | saveOptions | Object | Options passed to the "saveAll" function. | | chunkSize | Number | The chunk size of the promises. |

createRoleIfNotExists ⇒ ParseObject

Create a Role with the specified name (only if it doesn't alrady exists).

Returns: ParseObject - The created Role (undefined if the role already exists).
Category: Asynchronous.

| Param | Type | Description | | --- | --- | --- | | roleName | String | The Role name. | | saveOptions | Object | Options passed to the "save" command. |

isUserInRole ⇒ Boolean

Check if the the user is in a certain role.

Returns: Boolean - Is the user in the role? Category: Asynchronous.

| Param | Type | Description | | --- | --- | --- | | userId | String | The user objectId. | | roleName | String | The role name. |

loadClassesFromSchemas

Given an array of schemas of classes loads them in Parse Server

Category: Asynchronous.

| Param | Type | Description | | --- | --- | --- | | parseServerDb | Object | The Parse Server DB instance. | | schemas | Array | Array of schemas. | shouldUpdate | Boolean | Should the class be updated if it already exists? |