Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@elderjs/plugin-random

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elderjs/plugin-random

Easily preview a random page of a route by visiting a single url. This plugin should be used exclusively for development.

  • 0.1.44
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-90.91%
Maintainers
2
Weekly downloads
 
Created
Source

Elder.js Plugin: Random

Easily preview a random page of a route by visiting a single url. This plugin should be used exclusively for development.

What This Plugin Does:

When not running in process.env.NODE_ENV === 'production' this plugin does 2 things:

  1. It creates a /random/ route that lists each of your routes linking to /random/routeName/.
  2. It intercepts requests to /random/routeName/ and randomly serves a page for that route.

Benefits:

Say that you have a route named blog that has 1000 entries. With this plugin you could visit /random/blog/ and randomly design against any blog page instead of just one as most designers would do.

This is a simplistic example, but when building major sites with 10,000s of pages you'll often encounter scenarios where pages of the same route differ dramatically based on business logic.

By using this plugin, you can design and debug against random pages of a route without having to change the URL.

At ElderGuide.com we've found this is especially useful when working on a unified design across a route that can vary dramatically.

Having found this useful, it has now become a core part of our development process across all projects.

Install

npm install --save @elderjs/plugin-random

Config

plugins: {
  '@elderjs/plugin-random': {},
}

Notes:

  • When using this plugin with the @elderjs/plugin-browser-reload remember that /random/routeName/ will generate a new page each refresh. This can be annoying when working on CSS issues or thing that require stateful experiences on the front end.
  • If you are looking for the REAL url of a page look within request.permalink inside your Layout.svelte or RouteName.svelte files.

Keywords

FAQs

Package last updated on 04 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc