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 🙏

© 2026 – Pkg Stats / Ryan Hefner

oneql

v1.1.6

Published

<img src="./doc/oneql_text_left.png" width="400px" />

Readme

oneQL

Use koa + apollo-server-koa book: (https://oneqljs.github.io/oneQL/book/)

npm node Downloads GitHub license

Getting Started

  • npm install oneql-init -g
  • oneql-init project
  • cd project && npm install && npm run dev

Init oneQL (oneql-init create boilerplate)

// src/index.ts
import oneql from 'oneql'

import typeDefs from './types'
import resolvers from './resolvers'

new oneql({
    schema: {
        typeDefs,
        resolvers
    },
    context: async ({ ctx }) => {
        return {
            ctx
        }
    }
})

Example:

  • Open:(http://localhost:3600/graphql)
query db($key: String, $ext: [ExtensionType]){
  hello
  city(request: {key: $key,  ext: $ext } ) {
    datainfo{
      CountryId
      country
      type
    }
  }
}
QUERY VARIABLES
{"key":"D", "ext": [{ "key":"2", "value":"1"}] }

avatar

query simple{
  seatSimple {
    resultList{
      fInfo{
        fNo
      }
    }
  }
}

开发建议

  • 一个请求可以带多个schema,对应请求逻辑是resolvers文件夹下index.js, connect所有resolvers
  • 每一个最外层schema分一个对应的types文件和一个resolvers文件
  • types文件夹下index.js , connect所有types
  • 每一个schema具体数据实现,如果涉及请求,建议api文件夹里建一个文件处理逻辑

Util

  • util提供了soa请求封装,如自动处理埋点信息;
  • 提供xconfig集成;
  • 提供redis方法集成
  • 提供log方法集成

Production Environment

  • close graphlQL playground
  • app.config.js, env=prod // close
const server = new ApolloServer({
  typeDefs,
  // mocks
  resolvers
  // playground: false  // false为关闭
})

Mind map

avatar

License

MIT