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

catstack

v2.0.0-pre.20

Published

modular framework for real-time data-driven apps

Downloads

7

Readme

sponsored by Enspiral Root Systems

inspired by ahdinosaur/mad-science-handbook

for previous version, see catstack@1

features

  • provides development architecture which linearly scales complexity as your app evolves.
  • provides prescriptive opinions to bootstap teams onto a consistent development platform across projects.
  • everything is a depject module that can be overridden or combined.
  • app file structure maps to app modules, making it easy to separate concerns and get things done.
  • provides full stack app server for both development and production.
  • consistent concepts across front and back end.

demos

concepts

bin

gen

TODO

generate new project

catstack generate:project

start

dev

starts development server

catstack dev server

server

starts production server

catstack server

test

runs pull-test tests

can optionally take a glob

npm run test -- './todos/**/*.test.js'

default glob is ./**/*.test.js ignoring node_modules

lint

checks for standard style

can optionally take a glob

npm run lint -- './todos/**/*.js'

default glob is ./**/*.js ignoring node_modules

directory structure

the catstack files are organized in the following hierarchy:

${topic} / ${type} / ${module}.js

  • config/
    • config/index.js
    • config/${ NODE_ENV }.js
  • ${ topic }/
  • tests are any files that end in .test.js

topic overview

in contrast to frameworks like Rails which split our app into directories for each "type" of file (models, views, controllers), our app is split into directories for each conceptual topic, where each topic contains the various types of files within that topic.

each topic directory may contain any of:

  • state.js: exports initial store state
  • action/*.js: exports store actions
  • effect/*.js: exports effects
  • getter/*.js: exports reselect getters
  • page/*.js: exports routed views
  • element/*.js: exports presentation views
  • helper/*.js: exports helper functions
  • service.js: exports vas service

${ topic }/state.js

// cats/state.js`
module.exports = {
  create: () => ({
    init: () => ({
      model: {},
      effect: null
    })
  })
}

/${ topic }/action/*.js

// cats/action/create.js
module.exports = {
  create: () => ({
    update: (model, action) => {
      console.log('cat:create', model, action)
      return model
    }
  })
}

/${ topic }/effect/*.js

// cats/effect/fetch.js
module.exports = {
  create: () => ({
    run: (model, effect) => {
      console.log('cat:fetch', effect)
    }
  })
}

/${ topic }/get/*.js

// cats/get/cats.js
module.exports = {
  create: () => (state) => state.cats
}

/${ topic }/page/*.js

// cats/page/show.js
module.exports = {
  needs: {
    'app.layout.main': 'first',
    cats: {
      'element.profile': 'first',
      'get.show': 'first'
    }
  },
  create: (api) => ({
    route: '/cats/:catId',
    layout: api.layout.main,
    get: api.cats.get.show,
    view: api.cats.element.profile
  })
}

/${ topic }/element/*.js

// cats/element/profile.js
module.exports = {
  needs: {
    'inu.html': 'first'
  },
  create: (api) => ({
    view: (cat) => api.html`
      <div>${cat.name}</div>
    `
  })
}

/${ topic }/service.js

// cats/service.js
module.exports = {
  needs: {
    data: 'first'
  },
  manifest: {
    all: 'source',
    get: 'async'
  },
  create: function (api) {
    const cats = [{
      name: 'Fluffy'
    }, {
      name: 'Zoe'
    }]

    return {
      methods: { all, get }
    }

    function all () {
      return pull.values(cats)
    }

    function get (id, cb) {
      cb(null, data[id])
    }
  }
})

FAQ

how do i do relations between models?

implement them in your getters.js file as selectors.

in the future, we should extract common relations into helper creators.

license

The Apache License

Copyright © 2016-2017 Michael Williams

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.