本地储存库 StoreDB

码农软件 · 软件分类 · HTML5开发相关 · 2019-03-07 17:13:44

软件介绍

StoreDB是一个基于localStorage的本地储存库,通过模拟MongoDB的一些API和概念(如“集(collection)”和“文档(document)”),弥补了原生localStorage的多处不足,大大增强了localStorage的功能。

为什么要使用 StoreDB:

  • StoreDB使你在无须配置数据库的情况下,在静态页面中也能实现大量数据储存和交互。这意味着你能用StoreDB非常简便地建立一个功能强大的SPA(单页面应用,Single Page Application)。

  • StoreDB也适用于demo产品的开发。比如,假定你正在参加编程马拉松,你的团队只不过是想做出一个用以展示的demo,却不得不花 费时间在远程或本地架设server,再配置数据库,白白浪费了宝贵的时间。使用StoreDB,你只需嵌入一段javascript代码就能实现丰富的 数据交互。

  • 使用AngularJS配合StoreDB更是如虎添翼。

示例代码:

storedb('players').insert({"name":"Randy","sex":"male","score":20},function(err){
  if(!err){
    //do sth...
  } else //do sth...
})

storedb('players').find({"name":"Randy"},function(err,result){
  if(!err){
    //use result to do sth...
  } else //do sth...
})

本文地址:https://codercto.com/soft/d/838.html

JavaScript Patterns

JavaScript Patterns

Stoyan Stefanov / O'Reilly Media, Inc. / 2010-09-21 / USD 29.99

What's the best approach for developing an application with JavaScript? This book helps you answer that question with numerous JavaScript coding patterns and best practices. If you're an experienced d......一起来看看 《JavaScript Patterns》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具