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

ce-util

v3.0.7

Published

Utility for interacting with CE platform

Downloads

18

Readme

The Doctor | Cloud Elements Asset Management Tool


Version Downloads

Overview

The Doctor is a CLI tool to allow easy control management with Cloud Elements. This provides the ability to move between environments and to backup files locally or to GitHub.

Installation

$ npm install -g ce-util

PROTIP: node version must be >= v6.3.0

Setup

$ doctor init

The init function will create a hidden directory .doctor in your home directory. This folder will have a config.json that will store all your accounts.

An account consists of a name, orgSecret, userSecret and baseUrl. Make sure the baseUrl is formatted like: https://staging.cloud-elements.com, https://console.cloud-elements.com, or https://console.cloud-elements.co.uk

Usage

The doctor can download/upload assents from your Cloud Elements accounts to a directory or to a file.

GitHub

For use with GitHub, it is recommended to use the --directory option. This will export assets to an intuitive directory structure, and extract any JavaScript to its own file.

Versioning

Versioning in the doctor can be used to manage VDRs or Formulas in github using the -v flag. It allows deploying an updated versioned object to an environment without affecting the current deployed version. For upload the version is applied by appending "_{version}" to the name of the object being uploaded. For downloads the version will split on a "_" delimiter. Example download result "myFormulaName_v2" saves as "myFormulaName". Versioning currently only supports downloading of single objects using the -n

Continuous Deployment

For use with continuous deployment or just routine backups its recommended to just use the --file option. This will save space complexity as an entire CE environment can be represented as one file.

Commands

download    save objects locally
upload      imports objects into your account
delete      delete objects from your account
graph       graph a formula flowchart
accounts    manage accounts to use
init        initialize account
help [cmd]  display help for [cmd]

Objects

all
elements
formulas
vdrs
formulasInstances (delete only)
instances (delete only)

Options

-d, --directory for downloading/uploading to/from and directory
-f, --file for downloading/uplaoding to/from and file
-n, --name for downloading/uploading a specific entity or multiple comma-separated entities to/from and directory/file
-v, --version for downloading/uploading versioned objects

Examples

# list all accounts you have available to interact with
$ doctor accounts list

# removes an account from the list of accounts by the given account nickname or -n
$ doctor accounts remove -n devStaging

# add an account in one line
$ doctor accounts add -n devStaging -u <user secret> -o <organization secret> -b https://staging.cloud-elements.com

# import vdrs from a specified file path to an account (via nickname from your account list) Note: you can replace vdrs with formulas, elements, or all)
$ doctor upload vdrs staging -f ~/Desktop/vdrs-staging.json

# export vdrs from a specified account (note the account should be from your accounts list and you just need to denote the account name) to the given file path. Again: you can replace vdrs with formulas, elements, or all)
$ doctor download vdrs staging -f ~/Desktop/vdrs-staging.json

# export an vdr from the list of specified account vdrs to the given folder path. For elements, you need to pass element key using -n. Again: you can replace vdrs with formulas, elements
$ doctor download vdrs staging -n myVdr -D ~/Desktop/vdrs/

# export vdrs (comma-separated) from the list of specified account vdrs to the given folder path. For elements, you need to pass element key using -n. Again: you can replace vdrs with formulas, elements
$ doctor download vdrs staging -n vdr1,vdr2,vdr3 -D ~/Desktop/vdrs/

# export vdrs from specified account vdrs to the given folder path. (Note: use -u or --useNew boolean flag to download vdrs in new folder structure for more readability)
$ doctor download vdrs staging -D ~/Desktop/vdrs/ --useNew

# import an vdr from the list of specified account vdrs. For elements, you need to pass element key using -n. Again: you can replace vdrs with formulas, elements
$ doctor upload vdrs staging -n myVdr -D ~/Desktop/vdrs/

# import vdrs (comma-separated) from the list of specified account vdrs. For elements, you need to pass element key using -n. Again: you can replace vdrs with formulas, elements
$ doctor upload vdrs staging -n vdr1,vdr2,vdr3 -D ~/Desktop/vdrs/

# doctor delete has similar functionality but will not allow you to delete all. Please see doctor delete --help for more
$ doctor delete formulas accountName 

# export formulas separating out JS into files for easier version control
$ doctor download formulas staging -d ~/Desktop/formulas

# import or export specific entities by their name using -n, --name (You can pass list of comma-separated names)
$ doctor upload formulas staging -d ~/formulas -n specific\ formula\ name

# export a versioned object (example formula named myFormula_2)
$ doctor download formulas staging -f ~/formula.json -n myFormula -v 2

# import a versioned object (example formula named myFormula, version 3)
$ doctor upload formulas staging -f ~/formula.json -v 3

# generate flow chart for the specified formula
$ doctor graph formulas -f ~/Desktop/doctor/formula.json

Limitations

The doctor can not export instance or account level entities i.e. instances, instance or account level object definitions/transformations, accounts, users and formula instances.

Versioning is not supported for elements

Setup Local Development Environment

$ npm uninstall ce-util -g 
$ git clone https://github.com/CloudElementsOpenLabs/the-doctor.git
$ cd the-doctor
$ npm install -g
$ npm link