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

@ffras4vnpm/occaecati-accusantium-quisquam

v1.0.0

Published

[//]: # ( ) [//]: # (This file is automatically generated by a `metapak`) [//]: # (module. Do not change it except between the) [//]: # (`content:start/end` flags, your changes would) [//]: # (be overridden.) [//]: # ( ) # @ffras4vnpm/occaecati-accusanti

Downloads

3

Maintainers

lank831011lank831011

Keywords

irqeventsECMAScript 3toobjectfunctionalnative.envastargumentscsspackagestoArrayfolderstartconcatMaphelpersyamlregexconfigurablextermregularcorsiterationeast-asian-widthchromeArray.prototype.filtercopyECMAScript 2020errorsetPrototypeOfreact-hook-formmiddlewaretc39symbolswaitvaluesnamesdropobjES2015offsetgetoptfixed-widthomitpasswordnumbertypedarrayinstall-0urlscjkstructuredClonebootstrap lessfastcloneaccessorES6validateFloat32Arraytapestringifierfindinternal slotgenericstypeerrorexit-codeexecbcryptformsjapaneseperformancegradients css3httpcliminimalproplinkshamform-validationURLSearchParamsloggingbrowserslistvestcolumnObject.valuesflagstextES8iteratortranspileES2019airbnbframeworkassertionzerosettingsvalidconsthooksrateeslint-pluginmovetsserializeincludesshrinkwrapfindLastBigUint64Array@@toStringTaglintjQuerylinuxnegative zerocore-jsreusebddquotecryptoconsoleUnderscoresetImmediateviewes8bluebirdeslintconfigfastifyTypeBoxstatelessWebSocketsbabel-coregradients csstoolsoptimistoptimizerfromfetchStreamchinesezodthreesharedarraybufferfigletrmdefinePropertyes-shim APIestreegetOwnPropertyDescriptorfast-copydebugbuffereveryflatMapString.prototype.trimextensionprocessrapidreduxconfigrm -frreducefast-cloneexpressionformattingflagbusySymboltacitUint8ClampedArrayelectronfantasy-landbootstrap cssrangeerrorvaluedotenves6lockfileformxsswarningsortforEachpnpm9diffclassnamesserializationtakedebuggerObject.definePropertyES2018ramdareadableHyBislicedatamake dirfppoint-freeECMAScript 2017weaksetJSON-SchemaArrayBuffer#slicestreames7matchAllidleeslintpluginArray.prototype.findLastReflect.getPrototypeOfArray.prototype.findLastIndexprogresswalkingcall-bindcolumnsES2017throttlelinewrap$.extendObject.assignbuffersieconsumematchescharactersmochacallbacktapgetPrototypeOfUint32Arrayphonexhrreact-hooksIterator3d[[Prototype]]qsRxJSsanitizationObject.getPrototypeOfhandlerstrimescapetypescriptarraysdeterministicecmascripteditorloggerstyleguideeslintconcatdescriptorsutil.inspectshebangjsonpathjsonObject.iscommandECMAScript 2021serializerasciimimetypesArray.prototype.flatMaphookformes2016persistentyupTypedArrayECMAScript 2016validationstablebrowserlistbannerES2021picomatchtypeskoreanObject.keyslogdefineisConcatSpreadablemime-dblanguagevarECMAScript 5ESnextbabelclonequerystringterm

Readme

@ffras4vnpm/occaecati-accusantium-quisquam

@ffras4vnpm/occaecati-accusantium-quisquam is a routing utility allowing to map a path to a value

GitHub license Coverage Status

@ffras4vnpm/occaecati-accusantium-quisquam stands for "Shit In Shit Out". It allows to build routers without embedding a framework and falling into the gorilla banana problem ;).

It also match the French "ciseau" word pronunciation which means "chisel".

The parameters definition somewhat matches the Swagger one so that you will be able to use Siso with your swagger definition easily.

Usage

The @ffras4vnpm/occaecati-accusantium-quisquam concept is pretty simple. You associate paths patterns to values, then you pass a path in and get values and parameters out. And that's it, fair enough ;).

@ffras4vnpm/occaecati-accusantium-quisquam does not decide which separator is used for your paths so that you can use it for any routing concern.

import { Siso } from @ffras4vnpm/occaecati-accusantium-quisquam;

const @ffras4vnpm/occaecati-accusantium-quisquam = new Siso();

// Associate the '/v1/users' path to the 'user.list' value
@ffras4vnpm/occaecati-accusantium-quisquam.register([
  'v1',
  'users',
], 'user.list');

// Associate the '/v1/users/:id' path to the 'user.detail' value
@ffras4vnpm/occaecati-accusantium-quisquam.register([
  'v1',
  'users',
  {
    name: 'id',
    type: 'number',
    pattern: /^[0-9]+$/,
  },
], 'user.detail');

// Find a value for /v1/users/12
@ffras4vnpm/occaecati-accusantium-quisquam.find(['v1', 'users', '12']);
// Returns: ['user.detail', {id: 12}]

Note that you can provide any value for a given path. It may be a function, an array, an object or a string depending of your needs.

Despite its simplicity, @ffras4vnpm/occaecati-accusantium-quisquam is very opinionated since it won't allow you to define several values for the same path pattern and will throw if such situation happens.

It is very different from the kind of routing systems you probably used before. Frameworks like Express would allow registering several middlewares for the same path, for instance.

My opinion is that it is a bad thing. Every route should have a single handler and higher order functions should be used instead. That way, you have the overhaul workflow of each route in their own controllers. No magic, no need to guess what happens before/after the route handler. Read my blog post on this concern.

@ffras4vnpm/occaecati-accusantium-quisquam is just a building block, if you need a higher level way to deal with routers see swagger-http-router.

API

Siso

Siso

Kind: global class

new Siso()

Create a new Siso instance

Returns: Siso - The Siso instance
Example

import { Siso } from '@ffras4vnpm/occaecati-accusantium-quisquam';

const @ffras4vnpm/occaecati-accusantium-quisquam = new Siso();

@ffras4vnpm/occaecati-accusantium-quisquam.register(pathPatternNodes, value) ⇒ void

Register a value for a pattern path

Kind: instance method of Siso

| Param | Type | Description | | --- | --- | --- | | pathPatternNodes | Array | The various nodes of the path pattern | | value | any | The value registered for the given path pattern |

Example

import { Siso } from '@ffras4vnpm/occaecati-accusantium-quisquam';

const @ffras4vnpm/occaecati-accusantium-quisquam = new Siso();

// Path pattern nodes may be simple strings
@ffras4vnpm/occaecati-accusantium-quisquam.register(['v1', 'users'], 'user.list');

// Or parameters with a name and its corresponding node pattern
@ffras4vnpm/occaecati-accusantium-quisquam.register([
  'v1',
  'users',
  { name: 'id', pattern: /[a-f0-9]{24}/, type: 'string' },
], 'user.details');

@ffras4vnpm/occaecati-accusantium-quisquam.find(pathNodes) ⇒ void

Find the value for the given path

Kind: instance method of Siso

| Param | Type | Description | | --- | --- | --- | | pathNodes | Array | The path nodes for which to look for a value |

Example

import { Siso } from '@ffras4vnpm/occaecati-accusantium-quisquam';

const @ffras4vnpm/occaecati-accusantium-quisquam = new Siso();

@ffras4vnpm/occaecati-accusantium-quisquam.register([
  'v1',
  'users',
  { name: 'userId', pattern: /[a-f0-9]{24}/, type: 'string' },
], 'anotherValue');

@ffras4vnpm/occaecati-accusantium-quisquam.find(['v1', 'users', 'abbacacaabbacacaabbacaca']);
// ['anotherValue', { userId: 'abbacacaabbacacaabbacaca' }]

Authors

License

MIT