Coder Social home page Coder Social logo

spod's Introduction

spod (spit out data)

a little cli for spitting out data about a flat directory containing some json and markdown.

npm i spod -g

example

take a directory of directories

/example
  /an-entry-name
    - data.json
    - text.md
  /another-one
    - data.json
    - text.md
    - image.jpg

and output a json file to the root directory

/example
  /an-entry-name
  /another-one
  - data.json

which looks like this

{
  "an-entry-name": {
    "path": "an-entry-name",
    "title": "An Entry Name",
    "tags": ["whatever", "yeah"],
    "text": "This was contained in the markdown. Title and tags where in the json. Path was added automatically."
  },
  "another-one": {
    "path": "another-one" ,
    "title": "Another One",
    "date": "4/20/17",
    "text": "You can add arbitrary date to the json."
  }
}

i’m using this to create a psuedo-api of content which is hosted on github pages. i then made a separate stateful app which loads the data.json and can pull in any assets based off the directory name.

the idea is to separate the site and the content. with a simple enough taxonomy i can re-use this structure across versions of my personal site. pretty highly specific, but, yeah.

somewhat related is json feed, although this follows a different formatting convention (perhaps this should be unified?)

usage

spod add [dirname]

  • add/update entry to the log data

spod remove [dirname]

  • remove from the log data

spod watch

  • watch added entries for changes and write to the log.
  • spins up a local server at port 3000 to access /data.json

todo

  • testing
  • clean up entry methods
  • use args for watch to use server, port, etc…
  • add arg for including markdown text or not in the json

spod's People

Contributors

jondashkyle avatar

Stargazers

Mark Bucklin avatar Jacob Heftmann avatar Jurriaan avatar sonn-gamm avatar ᦔꪖ꠸ꪀ ᥇ꪶꪮᦔꪮ᥅ꪀ ᛕ꠸ꪑ avatar Oskar avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.