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

feathers-versionate

v0.2.2

Published

feathersjs service nesting utility

Downloads

1,032

Readme

feathers-versionate

About

Service nesting for feathersjs

Nests services under configurable base paths, and provides easy methods to access those services.

Getting Started

Install the module

NPM: npm install feathers-versionate --save

Yarn: yarn add feathers-versionate

var feathers = require('feathers');
var versionate = require('feathers-versionate');
var memory = require('feathers-memory');

const app = feathers();
// Configure versionate
app.configure(versionate());
// Register a base-path "/api/v2", and provide access to it via `app.v2`
app.versionate('v2', '/api/v2/');
// Now you can use `app.v2` to create and access services under the registered path!
app.v2.use('/users', memory); // http://localhost:3030/api/v2/users
// We can access services easily too!
const userService = app.v2.service('users');

Documentation

feathers-versionate It a utility that creates wrappers for app.use and app.service with nested root paths.

  • app.versionate(name, basePath)
  • app.versionate.register(name, basePath) (app.versionate alias)

feathers-versionate services

  • app.versionateName.use(path, service)
    • wraps app.use and includes the versionate basePath behind the scenes
  • app.versionateName.service(path)
    • wraps app.service and includes the versionate basePath behind the scenes

Examples

const app = feathers();
// Configure versionate
app.configure(versionate());
// Register a versionate base paths
app.versionate('v1', '/api/v1/');
// You can register as many "versionations" as you'd like
app.versionate('v2', '/api/v2/');
// If the 3rd argument is set to true, the service will be nested under app.versionate
app.versionate('docs', 'docs', true);
// Nesting under versionate is useful if you don't want to pollute `app` with lots of children
app.versionate.docs.use('quick-guide');

// Once registered, you can use app.versionateName anywhere in your app!
app.v1.use('/users', userServiceV1);
app.v2.use('/users', userServiceV2);

// Retrieve a service through the versionate name
const usersV2 = app.v2.service('users');
// You can also access services by their full path on app.service
const usersV1 = app.service('/api/v1/users');

// Use the service just like normal
usersV2.find().then(items => console.log('.find()', items));

Release History

0.2.2

  • Fix/add support for win32 systems

0.2.0

  • Add app.versionate as main function
  • Add tests
  • Fix app.versionate nesting of service access methods

0.1.0

  • Initial release
  • Support for app.use and app.service