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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ghost-deploy

v1.0.0

Published

Deploy your Ghost theme to a running Ghost instance

Readme

Ghost Deploy

Build Status Coverage Status NPM Version dependencies Status

Deploy your Ghost theme to a running Ghost instance

Installation

Ghost Deploy is available via the NPM Registry

npm install --save-dev ghost-deploy

Usage

Note: Ghost Deploy will overwrite an existing theme if it has the same name.


const deploy = require('ghost-deploy');
const {resolve} = require('path');

// execute build-related activities

return deploy({
  url: 'https://example.com',
  token: 'ghostAccessToken', // see the `Authentication` section
  themePath: resolve(process.cwd(), 'built', 'example-theme.zip'),
  activateTheme: true
}).then(() => {
  console.log('deployment succeeded!');
});

Deploy options

Required options: authentication, themePath, url

Authentication (required)

Note: the permissions of the token / password need to be able to upload and activate themes

A bulk of the options relate to authentication. Ghost Deploy supports 2 methods of authentication - token based, and password based. Password based authentication eventually becomes token-based authentication, but obtaining a token requires more effort on your end.

It doesn't matter what method you choose. If you're already using / creating a token in your code, you can pass that token to Ghost Deploy. Otherwise, don't worry about obtaining one; pass your credentials to Ghost Deploy.

If you go the token route, you just need to provide the access token

deploy({
  // Authentication by token
  token: 'accessToken',
  // Other options
});

If you go the password route, you need to provide the following details:

  • username (email) + password
    • This is how you log into Ghost from the admin panel
  • id + secret (short for client_id and client_secret)
    • Check out the API docs for information relating to creating a client. You don't need to add any trusted domains since this is run on a server / not client
deploy({
  // Authentication by password
  username: '[email protected]',
  password: 'Sup3R$3cUr3P@sS!!',
  id: 'ghost-deploy',
  secret: 'rAndOmLeTTerS',
  // Other options
});

example

Cleanup

If you use password authentication, Ghost Deploy will attempt to destroy the access and refresh tokens it created to upload your theme. This isn't guaranteed to work, although it should for the most part.

URL (required)

The URL for your Ghost instance. Make sure you don't mess this up, because otherwise your credentials / token will be sent to someone else. Ghost Deploy runs a very basic sanity check to make sure the API responds appropriately, but there's no guarantee it's a valid Ghost instance.

Ghost Deploy transforms the URL so you don't need to provide the entire thing

https://example.com becomes https://example.com/ghost/api/v0.1 https://example.com/ghost becomes https://example.com/ghost/api/v0.1 (etc)

deploy({
  url: 'http://localhost:2368', // Default Ghost url
  // Other options
});

Theme Path (required)

This is the path to your zipped Ghost Theme.

deploy({
  themePath: '/path/to/theme.zip',
  // Other options
});

Validate Theme (optional, default: true)

Ghost Deploy can validate your theme using gscan. All default options are used, and validation fails if there are any errors or warnings. If you're using an older ruleset (for example, gscan currently uses Ghost 2.0 rules - if you're on Ghost 1.x, theme validation will fail), or if you already run gscan as part of your deployment process, you can set this to false

deploy({
  // Other options
  validateTheme: false
});

Activate Theme (optional, default: false)

Ghost Deploy can activate your theme after uploading, although it doesn't by default. If you choose to not activate your theme (default), it will be available in the Ghost Admin panel, in the design section, to activate.

deploy({
  // Other options
  activateTheme: true
});

Putting it all together

You can see an example of how to use Ghost Deploy in our Acceptance Test

Issues and Support

Feel free to create an issue if you have any questions, feature requests or found a bug. As of now, there's no specific template, but if the volume of discussion gets out of hand, something will be put in place. If you want to contact us directly, shoot us an email - [email protected]

Contributing

Feel free to create a Pull Request if you think any changes should be made. You don't have to explain yourself, but be able to if requested.

License

Copyright 2018 HexR under the MIT License.