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

divshot-push

v1.4.2

Published

Deploy files to the Divshot hosting platform

Downloads

137

Readme

divshot-push

Deploy files to the Divshot hosting platform.

Install

npm install divshot-push --save

Usage

The following usage example pushes all files from the current directory up to Divshot.

var push = require('divshot-push');

var pushStatus = push({
  root: process.cwd(),
  environment: 'development',
  config: {
    name: 'app-name'
  },
  token: 'user auth token',
});

pushStatus.onUpload('start', function () {
  console.log('Upload started ...'); 
});

pushStatus.onUpload('end', function () {
  console.log('Complete!');
});

API

push(options)

  • options
    • root - REQUIRED: Full path the directory to push.
    • config - REQUIRED: App configuration data.
    • token - REQUIRED: User authentication token.
    • environment - OPTIONAL: Environment to push to. Defaults to development.
    • timeout - OPTIONAL: API http request timeout.
    • cacheDirectory - OPTIONAL: name of directory to store the caching hash files. Defaults to .divshot-cache/deploy

Push Status Events

The push method returns a set of event emitting methods to listen for various push status updates:

onEnd(callback)

The full push process is complete.

  • callback - Function to execute on event.

onError(callback)

There was an error pushing the app.

  • callback - Function to execute on event.

onVerbose(callback)

Verbose logging for debugging purposes.

  • callback - Function to execute on event.

onUpload(event, callback)

Events emitted while uploading files.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted upload events:

  • start - Uploaded has started. Callback is given count of files to upload.
  • progress - Emitted on file uploaded. Callback is given number of files uplaoded for this progress event.
  • end - Upload complete.
  • error - Error uploading files. Callback is given error object.

onBuild(event, callback)

Events emitted while creating an application build.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted build events:

  • start - Build has started.
  • end - Build complete. Callback is given the build object.

onHashing(event, callback)

Events emitted while hashing files for syncing on Divshot's servers.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted hashing events:

  • start - Hashing has started.
  • end - Hashing is complete.

onRelease(event, callback)

Events emitted while a release is being created.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted releasing events:

  • start - Releasing has started. Callback is passed the envrionment the app is being released to.
  • end - Releasing is complete.

onFinalize(event, callback)

Events emitted while release is being finalized.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted finalizing events:

  • start - Finalizing has started.
  • end - Finalizing is complete.

onApp(event, callback)

Events emitted if/when an app needs to be created before files are pushed.

  • event - Event to listen for.
  • callback - Function to execute on event.

Emitted App events:

  • create - App is being created. Callback is passed the name of the app.
  • end - App has been created. Callback is passed the app object.