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

cms-json

v0.2.23

Published

A headless CMS loading and saving its data from/to a json file

Downloads

55

Readme

cms-json

A lightweight CMS loading and saving its data from/to a json file

Build Dependencies NPM Downloads MIT Node.js version

cms-json: A lightweight CMS loading and saving its data from/to a json file

Install

npm install -g cms-json

Playground

You can give cms-json a shot in the playground. It runs the CMS with a default JSON and Schema files. The Save functionality is disabled, but you can export your work via the 'Export' button.

Quick Start

cms-json

Then open your browser at:

http://localhost:3000

Why do I need this?

In a small IT company, the question of how and by whom your website can be updated is a recurrent one.

I have explored many solutions, from pure HTML sites controlled by the dev team, using fancy web frameworks, to sites generated by the marketing/product team using pure wysiwyg tools like Adobe Muse, not to mention heavy stuff like Wordpress or Drupal.

I finally came up with that very simple feature set:

  • The Content part of my site is stored as a JSON file
  • It can be edited by tech or non tech people via a very simple UI
  • It is embedded in the web site / web app by developers, and exploited with the technology they like
  • It can be stored in Git, so that in case of conflicts, it can be solved as with any other source files
  • Last but not least, it can be run as an npm module. No Apache, no nginx, no PHP, no database, just simplicity of use.

Although tons of CMS products exist on the market, I didn't find any one fulfilling the constraints above.

Usage

Usage: cms-json {OPTIONS}

Standard Options:

    --schema, -s   JSON schema file.
                   Default is data/schema.json.

    --data, -d     JSON data file.
                   Default is data/data.json.

    --port, -p     Server port.
                   Default is 3000.

What's new

v0.1.1

  • The 'model' files are now standard JSON Schema Draft 6 files. See http://json-schema.org/.
  • Added a 'Developer' mode, to add/edit/delete nodes and fields. This mode is activated by default. Switching to 'Author' mode disables all schema editing features.
  • On a side note, I migrated the entire code base to Typescript.

v0.1.3

  • Show JSON data and schema on the right and sync with editor
  • Improved author view (removed useless dev stuff)

API

run([options]) ⇒ *

Run an Express server embedding a simple UI for editing the content of the given dataFile.

Kind: global function
Returns: * - The express app

| Param | Type | Description | | --- | --- | --- | | [options] | Object | | | [options.dataFile] | Object | A JSON file with the content. This parameter is mandatory. The content authored from the web site will be saved with that path name. The structure of this JSON file must match the model. See an example here: https://github.com/amelki/cms-json/blob/master/default/data.json | | [options.modelFile] | Object | A JSON schema file representing the model to support/ease authoring via the UI. This parameter is mandatory. See an example here: https://github.com/amelki/cms-json/blob/master/default/schema.json | | [options.port] | Object | The server port. 3000 by default |