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

clannad-sdk

v0.0.5

Published

back-end SDK for clannad

Downloads

1

Readme

NPM version Downloads

clannad-sdk

back-end HTTP SDK for clannad

initail

import CS from 'clannad-sdk';

const cs = new CS(options);

key in options

| key | type | default | descption | | ---- | ---- | ------- | ----- | | host | String | 127.0.0.1 | | | token | String | | project token from ROOT, will be send as headers['X-Token'] | | projectName | String | test | projectName for request |

basic handle

cs.auth

const result = await cs.list({token});

| field | type | descption | | --- | --- | --- | | token | String | token from your auth system (confrim by clannad.auth), will replace token in options |

response: 200 OK {auth}

cs.list

const result = await cs.list({tableName, token, selector});

fields in selector

| field | type | descption | | --- | --- | --- | | offset | Number | default 0(only list could use) | | limit | Number | default 30 (only list could use) | | sort | String | sort by one field, default createdAt (only list could use) | | asc | Boolean | default desc,you could set true to get asc (only list could use) | | populate | Object | for mongo populate handle, such as {"path": "field1","select": "name",populete:{"path":...}} | | select | Object | for select fields, such as ["field1","field2",...] | | params | Object | for mongoose conditions, such as {"field1":{"$gte":21},"field2":"duang",...} |

response: 200 OK [{_id: ..., ...}, ...]

cs.count

const result = await cs.count({tableName, token, params});

response: 200 OK {count}

cs.detail

const result = await cs.detail({tableName, token, selector});

response: 200 OK {_id: ..., ...}

cs.aggregate

const result = await cs.detail({tableName, token, params, group, sort});

| field | type | descption | | --- | --- | --- | | params | Object | for mongoose conditions, such as {"field1":{"$gte":21},"field2":"duang",...} | | group | Object | a JSON about $group operator to this aggregate pipeline, such as {"_id":"$field1","num":{"$sum":1}} | | sort | Object | a JSON about sorts all input documents, such as {"field1": -1, "field2": 1} |

response: 200 OK [{_id: ..., ...}, ...]

cs.add

const result = await cs.add({tableName, token, data});

response: 200 OK {id}

cs.edit

const result = await cs.edit({tableName, token, params, data});

response: 204 No content

cs.delete

const result = await cs.delete({tableName, token, params});

response: 204 No content

develop

$ make dev