Coder Social home page Coder Social logo

ajrulez / sag-js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbisbee/sag-js

0.0 1.0 0.0 495 KB

A simple but powerful Node.js library for talking to CouchDB.

Home Page: http://www.saggingcouch.com

License: Apache License 2.0

Makefile 1.44% JavaScript 97.95% HTML 0.61%

sag-js's Introduction

Sag-JS
======

Version 0.4.0
http://www.saggingcouch.com

Sag-JS is a JavaScript library for working with CouchDB that works in both
browsers and Node.JS. It is a port of the popular Sag PHP library and is
completely API compliant, with the addition of callbacks for dealing with
JavaScript's asynchronous nature.

Sag is designed to not force any particular programming method on its users -
you just pass objects in and get objects back. This makes it trivial to
include Sag in your application, build different functionality on top of it,
and expand Sag to include new CouchDB functionality.

Install
-------

Node: `npm install sag` or include the source file in your project.

Browser: Include the source file in your project and embed it with a script
tag.

Compatability
-------------

Sag-JS is API compatible with Sag 0.7.1 with a few asynchronous language
specific additions.

Each release is tested with an automated testing suite against these
combinations of software:

  Apache CouchDB: 1.1.x, 1.2.x, 1.3.x

  Node.JS: 0.8.x and 0.10.x (stable releases only)

  Browsers: FF >= 3.5, Chrome >= 15, and IE >= 7

Lower versions will likely work with Sag-JS but are not officially supported,
so your mileage may vary.

Contents
--------

CHANGELOG                       A detailed list of all changes between
                                releases, including any breaking changes.

LICENSE                         A copy of the license Sag-JS is released under.

NOTICE                          Copyright notices.

README                          This file.

Makefile                        Used to run unit tests, create releases, etc.

src/                            This directory contains the pieces of source
                                code tha will be combined to make the sag.js
                                file. If you are building from source, then
                                just run `make` to generate the file.

tests/                          Contains the automated testing suite for
                                Sag-JS and its own documentation.

Error Handling
--------------

Sag's paradigm of simplicity is carried into its error handling by allowing
you to send data to CouchDB that will result in errors (ex., malformed JSON).
This is because CouchDB knows when there is an error better than Sag. This
also makes Sag more future proof, instead of worrying about each of CouchDB's
API changes. Therefore, Sag will only look for Sag-JS interface problems and
issues that are native to JS, such as passing an int instead of a string.

All local errors are floated back to your application with exceptions. Sag
does not catch any errors itself, allowing your application to care about them
or not.

CouchDB errors will be exposed through the response object. Additionally the
second parameter of the callback functions is set to `true` if a non-2xx HTTP
status was returned.

Networking
----------

Sag-JS automatically detects whether it is in a Node.JS or browser environment
and selects which networking tools to use accordingly.

Node.JS uses the HTTP module found in every Node.JS release.

Browser current uses XHR, which makes cross domain requests unfeasible. Future
versions will include support for cross domain requests.

More Info
---------

Detailed documentation of the functions and API are available at
http://www.saggingcouch.com

License
-------

Sag-JS is released under the Apache License, version 2.0. See the file named
LICENSE for more information.

Copyright information is in the NOTICE file.

sag-js's People

Contributors

sbisbee avatar

Watchers

James Cloos 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.