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

@khalidx/resource-x

v1.4.1

Published

Resource and domain modeling for quick APIs, CMSs, and applications.

Downloads

20

Readme

resource-x

Resource and domain modeling for quick APIs, CMSs, and applications.

GitHub package.json dynamic

GitHub GitHub package.json version GitHub top language

GitHub last commit

Quick start

Deploy an API to the cloud in under 30 seconds, in just 3 steps.

tutorial

  1. Build your domain objects as JSON Schemas, all in the same Markdown document. Alternatively, run rx init to get a ready-to-use document with two sample schemas.

  2. When you run rx generate sample.md, you'll get a full CRUD (create-read-update-delete) Swagger specification for your API.

  3. You can then deploy your specification to AWS API Gateway, complete with request validation and mock responses, with a single rx deploy sample.md command.

How easy was that?

Features

  • Domain modeling with simple schema objects
  • Markdown support for easy writing, easy sharing, and good documentation
  • Generate a full CRUD Swagger REST API with a single command
  • Deploy a fully mocked API to AWS API gateway with a single command
  • Request validation based on your schema objects
  • Generates useful files that you can use with other tools, like terraform and postman
  • CLI application works on Windows, Mac, and Linux, and everywhere node is supported
  • Open source + free forever, with excellent support

Installation

Installing is easy with npm.

npm install -g @khalidx/resource-x

Alternatively, you can also download a binary for your operating system.

Windows, Mac, and Linux are all supported.

Usage

Initialize a new sample project in the current directory.

rx init

init

Generate an API specification from the document file.

rx generate <file>

generate

Opens the browser to view the resources in the document file.

rx browse <file>

browse

Deploy the API with mock integration to AWS API Gateway.

rx deploy <file>

deploy

Undeploy the API from AWS API Gateway.

rx undeploy <file>

undeploy

Remove the generated .rx/ directory.

rx clean

clean

See help and usage information about all available commands.

rx --help

help

Pro tips and tricks

  • Commit the .rx/**/deploy.json files. These track your AWS API Gateway deployments, so that you don't end up creating a new API every time you check out from git and deploy.

  • If you've already deployed your API, then later decide to rename it (by changing the heading in the Markdown document), make sure you also rename the corresponding .rx/ directory for the API. This will ensure that you deploy an update to the same API rather than creating a new one.

  • Make sure you only use AWS API Gateway compatible schema definitions. AWS does not support the full Swagger definition language. Read more about what is supported (and what isn't) in the AWS documentation.

  • You may want to do more advanced things with your API that this tool does not support. You can still use the tool to get started and generate a Swagger definition, then modify your definition by hand or with other tools before uploading to AWS manually. This will still save you some time, since writing the initial Swagger with all operations and AWS support is very time consuming.

  • The module generates a main.tf file for your Swagger specification. This lets you import and continue your workflow in terraform!

Support

Open a GitHub issue to ask a question, report a bug, raise a concern, or request a new feature.

Also, your question may already be answered on the following Hacker News thread.