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

ghost-blade

v0.1.0

Published

A slightly opinionated convenience wrapper for the ghost blog system that lets you use ghost as an express middleware.

Downloads

3

Readme

ghost-blade

A slightly opinionated convenience wrapper for the ghost blog system that lets you use ghost as an express middleware. While being similar to ghost-on-heroku (thanks for the inspiration), it enables you to run ghost on any JS hosting platform.

Installation

npm install ghost-blade

API

ghost-blade exports a function that takes a ghostConfig object and returns a promise of an express middleware. The ghostConfig object is checked for secure production settings and then passed directly to ghost. See all config options at Configuring ghost.

Use the config file examples below as a starter. ghost-blade prohibits insecure settings or settings involving local file storage to enable you to run your blog on popular JS hosting services (e. g. Heroku, Bitnami).

Usage example

// index.js
import express from 'express'
import ghostBlade from 'ghost-blade'
import logger from 'winston'

import config from './config.js'
import ghostConfig from './ghostConfig.js'

var app = express()

ghostBlade({ghostConfig})
    .then(function (ghostBladeMiddleware) {
        app.use('/', ghostBladeMiddleware)
        app.listen(config.server.port, config.server.host, function () {
            logger.info('listening on ' + config.server.host + ':' + config.server.port + ' in ' + process.env.NODE_ENV + ' mode')
        })
    })
    .catch(function (e) {
        logger.error(e)
    })
// config.js
const config = {
    development: {
        server: {
            host: 'localhost',
            port: 1336
        }
    },
    production: {
        url: 'http://yourapp.com',
        server: {
            host: '0.0.0.0',
            port: process.env.PORT || 1336
        }
    }
}

export default config[process.env.NODE_ENV]
// ghostConfig.js
export default {
    development: {
        url: 'http://localhost:1336',
        database: {
            client: 'mysql',
            connection: mysql://user:password@host/database
        }
    },
    production: {
        url: process.env.URL,
        database: {
            client: 'mysql',
            connection: mysql://user:password@host/database
        },
        fileStorage: false,
        forceAdminSSL: true
    }
}