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

fathom

v0.3.0

Published

Node tooling for Parse.com

Downloads

10

Readme

Fathom

Fathom is a Node.js command line application that communicates with Parse using the REST API.

Installation

~ npm install -g fathom

Configuration

Create a .fathomrc file at the root directory of your project:

{
    "restapi": "[ REST API key ]",
    "appid": "[ Application ID ]",
    "apiurl": "https://api.parse.com",
    "apiversion": 1
}

Usage

~ fathom -h

    Usage: fathom [options]

    Options:

        -h, --help                      output usage information
        -V, --version                   output the version number
        -p, --path [String]             Required: request path
        -m, --method [GET|POST|DELETE]  Optional: request method, defaults to "GET"
        -d, --data [String]             Optional: request payload, JSON String or path to JSON file.

Creating Objects

Fathom uses Parse import data format, read more about it here.

Using inlined JSON data:

fathom -m POST -p classes/MyClass -d '{"results": [{"name":"My First Object"}]}'

Using a JSON file:

data.json:

{
    "results":
    [
        {
            "name": "My First Object"
        }
    ]
}

Then:

~ fathom -m POST -p classes/MyClass -d data.json

{
    "createdAt": "2014-02-16T12:59:25.869Z",
    "objectId": "ik9DjkW8kH"
}

Creating many objects at once

Internally implemented using using a batch operation

data.json

{
    "results":
    [
        {
            "name": "My First Object"
        },
        {
            "name": "My Second Object"
        },
        {
            "name": "My Third Object"
        }
    ]
}

Then:

~ fathom -m POST -p classes/MyClass -d data.json

[
    {
        "success": {
            "createdAt": "2014-02-16T13:08:44.275Z",
            "objectId": "u9Y4JBVaks"
        }
    },
    {
        "success": {
            "createdAt": "2014-02-16T13:08:44.303Z",
            "objectId": "5jTwudV7zk"
        }
    },
    {
        "success": {
            "createdAt": "2014-02-16T13:08:44.319Z",
            "objectId": "qC60wI5Fel"
        }
    }
]

Retrieving Objects

Retrieving one object

~ fathom -m GET -p classes/MyClass/u9Y4JBVaks

{
    "createdAt": "2014-02-16T13:08:44.275Z",
    "name": "My First Object",
    "objectId": "u9Y4JBVaks",
    "updatedAt": "2014-02-16T13:08:44.275Z"
}

Retrieving all objects from a class

~ fathom -m GET -p classes/MyClass

{
    "results": [
        {
            "name": "My First Object",
            "createdAt": "2014-02-16T13:08:44.275Z",
            "updatedAt": "2014-02-16T13:08:44.275Z",
            "objectId": "u9Y4JBVaks"
        },
        {
            "name": "My Second Object",
            "createdAt": "2014-02-16T13:08:44.303Z",
            "updatedAt": "2014-02-16T13:08:44.303Z",
            "objectId": "5jTwudV7zk"
        },
        {
            "name": "My Third Object",
            "createdAt": "2014-02-16T13:08:44.319Z",
            "updatedAt": "2014-02-16T13:08:44.319Z",
            "objectId": "qC60wI5Fel"
        }
    ]
}

Deleting Objects

Deleting one object

~ fathom -m DELETE -p classes/MyClass/u9Y4JBVaks

{}

Deleting many objects

Internally implemented using using a batch operation

data.json

{
    "results": [
        {
            "objectId": "5jTwudV7zk"
        },
        {
            "objectId": "qC60wI5Fel"
        }
    ]
}

Then:

~ fathom -m DELETE -p classes/MyClass -d data.json

[
    {
        "success": true
    },
    {
        "success": true
    }
]

Deleting all objects from a class

Internally implemented using using a batch operation

~ fathom -m DELETE -p classes/MyClass

[
    {
        "success": true
    },
    {
        "success": true
    },
    {
        "success": true
    }
]

Updating objects

Given you already know objectId, you can create a data.json file:

{
    "results":
    [
        {
            "message": "hello"
        }
    ]
}

Then:

~ fathom -m PUT -p classes/MyClass/ik9DjkW8kH -d data.json

{
    "updatedAt": "2014-03-01T14:22:45.103Z"
}

Using inlined JSON

All the operations that take a JSON file as argument can take inline JSON as well:

~ fathom -m PUT -p classes/MyClass/8eccnwrv7L -d '{"results": [{"message":"hello"}]}'

Using the master key on requests

It is possible to pass the Parse master key in your requests. This is necessary when deleting or updating users without a login session. Using the flag -M or --master the master key on your config file will be passed along your request:

~ fathom -M -m PUT -p users/KvFII6hObe -d data.json

or

~ fathom --master -m PUT -p users/KvFII6hObe -d data.json

Users

Creating Users

~ fathom -m POST -p users -d data.json

Note: Creating multiple users at once is not supported.

Retrieving Users

~ fathom -m GET -p users/KvFII6hObe

Deleting Users

~ fathom --master -m DELETE -p users/KvFII6hObe

Note: Deleting multiple users at once is not supported.

Updating Users

~ fathom --master -m PUT -p users/KvFII6hObe -d data.json

Roadmap

  • 0.1 (Released):

    • GET, POST, DELETE on classes
  • 0.2 (Released):

    • PUT on classes
  • 0.3 (Released):

    • Master key on configuration
    • POST, PUT, GET, DELETE on users
  • 0.4:

    • query strings
    • Session tokens
    • GET on login
    • GET on users/me
    • POST, PUT, GET, DELETE on roles

Changelog

v0.3.0

  • date: 2014-15-18
  • changes:
    • readme.md
    • new --master -M flag allows to pass the master key on requests
    • POST, PUT, GET and DELETE on users

v0.2.1

  • date: 2014-03-12
  • changes:
    • update on readme.md
    • update on cli help

v0.2.0

  • date: 2014-03-01
  • changes:
    • PUT on classes

v0.1.2:

  • date: 2014-02-16
  • changes:
    • readme.md

v0.1.1:

  • date: 2014-02-16
  • changes:
    • removing -o --objectid from CLI API
    • changing data input format to match parse import format
    • allowing inline JSON input for -d --data

v0.1.0:

  • date: 2014-02-12
  • changes:
    • GET, POST, DELETE on classes
    • CLI API
    • CLI help