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

@getcronit/pylon

v2.6.1

Published

![Pylon cover](https://github.com/user-attachments/assets/c28e49b2-5672-4849-826e-8b2eab0360cc)

Downloads

1,216

Readme

Pylon cover

Documentation NPM Discord

Introduction

A framework for building GraphQL APIs without defining any kind of schema. It reduces the time spent on writing and maintaining API definitions, allowing you to focus solely on writing your service logic.

Why

We believe that the current approach to building APIs is outdated. Writing and maintaining API definitions is time-consuming and error-prone. When you already have TypeScript definitions, why not use them to infer the API schema? Pylon does exactly that.

Pylon also provides a set of tools to help you build, test, and deploy your APIs. We believe that building services should be easy and fun. Major functionalities like authentication, authorization, and context management are built-in, so you can focus on what matters most: your service logic.

With Pylon, you can build APIs faster, with fewer errors, and with less code.

Create

To create a new Pylon project, run the following command:

npm create pylon@latest

Afterwards, you can navigate to the newly created project and start the development server:

cd my-pylon
npm run dev

This will start the development server on http://localhost:3000.

Open the Pylon Playground in your browser and start building your API.

Develop

Update your service logic in the src directory.

import {app} from '@getcronit/pylon'

export const graphql = {
  Query: {
    user: (id: string) => {
      return {
        id,
        name: 'John Doe',
        email: '[email protected]'
      }
    },
    products: () => [
      {id: '1', name: 'Laptop', price: 999.99},
      {id: '2', name: 'Smartphone', price: 499.99},
      {id: '3', name: 'Tablet', price: 299.99}
    ]
  },
  Mutation: {
    updateUserEmail: (id: string, newEmail: string) => {
      return {
        id,
        email: newEmail
      }
    },
    createOrder: (userId: string, productIds: string[]) => {
      return {
        id: 'order-123',
        userId,
        productIds,
        status: 'PENDING'
      }
    }
  }
}

export default app

Query:

query GetUser {
  user(id: "1") {
    id
    name
    email
  }
}

query GetProducts {
  products {
    id
    name
    price
  }
}

Mutation:

mutation UpdateUserEmail {
  updateUserEmail(id: "1", newEmail: "[email protected]") {
    id
    email
  }
}

mutation CreateOrder {
  createOrder(userId: "1", productIds: ["1", "2"]) {
    id
    userId
    productIds
    status
  }
}

Deploy

Pylon is fully compatible with Cloudflare Workers, allowing you to deploy your service to the edge in just one minute. Watch the video below to see how easy it is to deploy a Pylon.

Cloudflare Workers

If you prefer to deploy your service to a different platform, you can use the provided Dockerfile to build a Docker image and deploy it to your favorite cloud provider.

docker build -t my-pylon .
docker run -p 3000:3000 my-pylon

Runtimes

Designed to be flexible, Pylon can be run on various platforms, including:

| | | | | | :------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------: | --------------------------------------------------------------------------------- | | Bun.js | Node.js | Cloudflare Workers | Deno |

Features

Pylon offers a comprehensive set of features to streamline the development of modern web services:

| Feature | Description | | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | | Automatic Schema Generation | Pylon generates GraphQL schemas based on your TypeScript definitions, ensuring type safety and reducing manual coding effort. | | Type Safety | By leveraging TypeScript, Pylon ensures that your services are type-safe, catching errors at compile time. | | Authentication and Authorization | Built-in support for OIDC standard and integration with ZITADEL for managing user authentication and role-based access control. | | Logging and Monitoring | Sentry for error tracking, providing robust monitoring capabilities. | | Database Integration | Seamlessly works with Prisma to generate extended models that support automatic resolution of relations and paginatable connections. | | Deployment Ready | Includes pre-configured Dockerfile for easy deployment using Docker or manual methods. |

Playground

You can try Pylon in the Playground without installing anything. Or simply click the image below to open the Playground.

Playground

Contributing

Documentation, bug reports, pull requests, and other contributions are welcomed! See CONTRIBUTING.md for more information.

Support

  • Community Support: Join the Pylon community on GitHub to report bugs and request features.
  • Professional Support: For professional support and consulting services, contact [email protected].
  • Join the Pylon Discord server to connect with other users and contributors.

Pylon is brought to you by Cronit.