New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

americano-cozy-pouchdb

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

americano-cozy-pouchdb

Americano helpers to build Cozy applications faster with PouchDB

  • 0.3.18
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Americano Cozy

When you want to write Cozy applications with Americano, you don't have the good helpers to write your models. Here are some that could make your life easier, notably about declaring your requests.

Getting Started

Add americano-cozy to the list of your plugins in the Americano configuration file. Then add it as a dependency of your project:

npm install americano-cozy -g

Models

Do no think about including JugglingDB and its configuration for Cozy anymore, Americano Cozy does the job for you:

americano = require 'americano-cozy'

module.exports = americano.getModel 'Task',
    done: Boolean
    completionDate: Date

Requests

Describe your Data System requests in a single file:

# server/models/requests.coffee
americano = require 'americano-cozy'

module.exports =
    task:
        all: americano.defaultRequests.all
        analytics:
            map: (doc) ->
                if doc.completionDate? and doc.done
                    date = new Date doc.completionDate
                    dateString = "#{date.getFullYear()}-"
                    dateString += "#{date.getMonth() + 1}-#{date.getDate()}"
                    emit dateString, 1
            reduce: (key, values, rereduce) ->
                sum values

What about contributions?

Here is what I would like to do next:

  • write tests
  • remove async from the dependency (use recursive functions instead)
  • make Data System URL configurable

I didn't start any development yet, so you're welcome to participate!

Keywords

FAQs

Package last updated on 19 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc