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

json-save-lite

v1.0.5

Published

lite json db system

Downloads

1

Readme

简介

是轻型的json存储数据库...((?)

支持:

  • 查询json列表
  • 获取整个库对象
  • 获取单个库对象
  • 获取键值
  • 云端导入导出json文件

快速开始


demo.ts

import litejson from './main/index'


const lJson = new litejson(__dirname, 'admin', null)

lJson.modifyPointer('json库1')
lJson.addSingle('a', 'b')
lJson.addArray('a',['c','d','e','f'])


console.log(lJson.readKeys('a'))
console.log(lJson.readObject('json库1'))

API


litejson(存储根目录, 当前操作者用户名, 远程存储服务器(若无则写null))

lJson.getDBObject()                 获取全部数据库的整合json对象  - 返回为一个对象
lJson.getDBList()                   获取已有数据库列表            - 返回值为[库名,库名]
lJson.findDB('关键词')              查找包含此关键词的词库        - 返回值为[库名,库名]
lJson.findTrigger('关键词')         查找包含此关键词的键存在位置  - 返回值为[[库名, 问],[库名, 问]...]
lJson.findReport('关键词')          查找包含此关键词的值存在位置  - 返回值为[[库名, 问, 答],[库名, 问, 答]...]
lJson.addSingle('键', '值')         为键添加一个值                - 返回为此键的长度
lJson.setKey('键', ['值1','值2'])   为键添加一些值                - 返回是否成功
lJson.addArray('键', ['值1','值2']) 将键设置为一个值              - 返回是否成功
lJson.del('键', '1')                删除键的某个下标              - 返回是否成功
lJson.del('键', 'all')              删除整个键                    - 返回是否成功
lJson.download('下载码')            下载json到本地(覆盖)          - 返回是否成功
lJson.upload('库名')                上传某个json到云端            - 返回下载码/失败
lJson.modifyPointer('库名')         设置编辑指针                  - 返回是否成功
lJson.resetPointer()                重置编辑指针                  - 返回是否成功
lJson.readKeys('键')                获取键的值                    - 返回键值[]
lJson.readObject('库名')            获取库对象                    - 返回库对象{}


/*
编辑指针代表当前正在编辑哪个库
*/

服务端

云存储服务端