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

restapify

v2.3.4

Published

<p> <img src="./docs/assets/banner.png" alt="restapify cover" width="500"> </p>

Downloads

4,926

Readme

Restapify

Restapify is a tool that allows you to quickly and easily deploy a local REST API by using an intuitive and developer friendly JSON file structure.


Summary

Why Restapify

When you start a new frontend project when the backend is not yet ready, you quickly come to the question of how to retrieve the data to be displayed. There are then many solutions that come with advantages but also some inconveniences. It's possible to use a tool like postman but it's not 100% free and require an account, to simply fetch local JSON data but it only supports a GET request or use a mocker library like json-server, mocker-api or http-fake-backend.

The problem of most of this libraries is the way you have to define your API endpoints (a single file for all the routes, javascript files that took almost the same time to code than the real API, ...). Restapify try to make this process even faster with a file structure close to the one that you can see in Nextjs or Sapper and some developer friendly syntaxes to populate your json files.

Features

  • 💡 Incredible DX - Intuitive files structure and JSON syntax
  • JSON valid - You will only use .json files that follows the ECMA-404 standard
  • 🎛 Dashboard - Out of the box SPA to explore and manage your mocked API
  • 💻 CLI - Use the CLI for an instant deployment
  • 🔥 Built in hot watcher - Directly see your changes after a file update
  • 📝 Fakerjs implementation - Intuitive syntax to quickly populate your API responses
  • 🚨 Events handler - Execute callbacks on specific events
  • 🛡 TypeScript support

Documentation

Checkout the documentation on the website or directly read it from the Markdown source file.

Getting Started

Using the cli

The simplest way to use Restapify is to use his cli:

npm i -g restapify

and then serve the api folder:

restapify serve path/to/folder/

Using the JavaScript class

You can install restapify's class using npm (note that this package should be a devDependency):

npm i -D restapify

You can then import the class and instantiate it to serve the api folder:

import * as path from 'path'
import Restapify from 'restapify'

const apiFolderPath = path.resolve(__dirname, './path/to/folder')

const rpfy = new Restapify({
  rootDir: apiFolderPath
})
rpfy.run()

Contributing

All remarks are welcome so feel free to open an issue. Wants to collaborate? Please read the contributing guidelines.