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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sofajs

v0.0.11

Published

couchdb interface builder

Downloads

24

Readme

sofajs

sofajs provides a framework to interface with couchdb. Code is grouped and labelled in three types of modules: requests, tools (helpers), and promises. This stores all couchdb request logic in a sofajs object and to be conveniently consumed in an application.

Besides the above, sofajs also provides the ability to write and build design logic. couchdb view and update design functions built using sofajs' design object are then generated using the 'npm run load'. This command also generates the fixture data you may write inside the design object. 'npm run load' destroys the database, builds a new one, generates the projects design functions, and then loads all fixture data.

If sofafest.js is configured to 'live' then 'npm run load' does not destroy the database,
does not load fixtures and will only reload design functions.

Install

npm install sofajs

See it in Action

  • Sample https://github.com/sofajs/sample

Three types of modules

  • request modules contain methods exposed to the outside world and are to be consumed by other applications. tool and promise methods are not exposed and are only to be consumed within the sofajs application.

  • tool modules are helper methods to be consumed by the request methods.
    They allow the logic of requests to be separated into other functions and tested.

  • promise modules are modules for grouping promises in labelled modules. Frequently wrote duplicate or similar promise code which inspired the creation of this type of module. It keeps all promises in one place, labelled in groups, and ready for reuse as needed.

testing

another advantage of sofajs and it's module design is easy isolation of functions for testing making it convenient to write good test coverage. When testing, use the getInternals() methods to get access to tool and promise methods for writing test coverage.

docos documentation server

https://github.com/sofajs/docos The sofajs request object has a 'comment' member where documentation is written for each function using gfm (git flavored markdown). After writing couchdb request logic the sofajs way, execute 'npm run docos' and a server starts up displaying a web application containing all the documentation written for each request. See sample project for how to configure a project to use docos.

Extendable

There is a manifest file which configures how many modules are included in a sofajs project. In theory there is no limit to how many modules to be added. Plus, the module design allows for development to be done separately by different developers and combined later if desired.

DB Connections

sofajs uses nano when making couchdb requests. A database connection is guaranteed before requests are executed. nano's methods are accessed using the sofaInternals.db object.

current test status

npm run load This will load/reload designs and fixture data. sometimes may need to run above command twice. npm test 87% coverage

Testing

require 100% test coverage using: lab and code test coverage 87%

Style Guide

Project follows: hapijs coding conventions

License

LICENSE

More on Designs

A core concept of couchDB is orgnizing and searching your data using design documents. sofajs supports the construction of views and update functions and generates design documents for you. Plus, the design document builder logic supports the loading of fixture data for each design document.