Expose top-level identifiers in Next.js app.js

Overview

recma-nextjs-static-props

Expose top-level identifiers in Next.js app.js

Installation

npm install recma-nexjs-static-props

Usage

This plugin is intended for use with Next.js and MDX.

import nextMDX from '@next/mdx'
import recmaNextjsStaticProps from 'recma-nextjs-static-props'

const withMDX = nextMDX({
  options: {
    recmaPlugins: [recmaNextjsStaticProps],
  },
})

export default withMDX()

API

The default export is a recma plugin which exposes variables from the top-level scope in Next.js through getStaticProps.

Options

  • name: The name of the export to generate. (Default: 'getStaticProps')
  • include: A list to filter identifiers to include in the generated function. This list may include strings which must be matched exactly, a regular expression to test against, or a function that will be called with the value to test, and must return a boolean. By default everything will be included.
  • exclude: The same as include, but matching values will be excluded instead.

Example

The source code repository for this plugin is setup as a Next.js project.

To try it yourself, simply clone, install, and run this project:

git clone https://github.com/remcohaszing/recma-nextjs-static-props.git
cd recma-nextjs-static-props
npm ci
npm run dev

Related Projects

This plugin works well with the following MDX plugins:

License

MIT © Remco Haszing

You might also like...

Next-level mongoose caching layer with event based cache clearing

SpeedGoose ## About The Project This project is a next-level mongoose caching library which is fully written in typescript. It's caching on two levels

Dec 15, 2022

Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Next-level academia! Repository for the Native Overleaf project, attempting to integrate Overleaf with native OS features for macOS, Linux and Windows.

Native Overleaf Overleaf is a fantastic webtool for writing and cooperating on LaTeX documents. However, would it not be even better if it were to beh

Dec 18, 2022

🚀 Final Esports project based on Rocketseat's Next Level Week.

🚀 Final Esports project based on Rocketseat's Next Level Week.

The evolved version of the Esports project on the Next Level Week by Rocketseat. The web client is deployed on Vercel here: https://nlw-esports-ignite

Oct 26, 2022

Projeto construído do evento Next Level Week da Rocketseat

Projeto construído do evento Next Level Week da Rocketseat

Tecnologias | Projeto | Layout | Licença 🚀 Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: Node.js React ReactNative Expo Typ

Sep 18, 2022

A next-gen web framework made on top of bun

Eviate JS (WIP) Next-generation web framework to build powerful apps Features Simple: No more req or res. It's all ctx (context) and plain objects! Fa

Oct 30, 2022

Solana blockchain candy machine app boilerplate on top of Metaplex Candy Machine. NextJS, Tailwind, Anchor, SolanaLabs.React, dev/mainnet automation scripts.

NFT Candy Factory NOTE: This repo will prob only work on unix-based environments. The NFT Candy Factory project is designed to let users fork, customi

Dec 30, 2022

A messaging app built on top of Solana blockchain where you can store and view your messages.

Message App on Solana 💬 This Message application written Rust using Anchor ⚓ Setting up the Environment: Rust Installation curl --proto '=https' --tl

Oct 2, 2022

The leaderboard web app displays the top scoring player on the fictional game of life.

The leaderboard web app displays the top scoring player on the fictional game of life.

Leaderboard is website that displays the scores submitted by all players. It also allows the current user to submit his/her score. All data is preserved thanks to the external Leaderboard API service.

Nov 23, 2022

A pomodoro web app with features like always on top PIP mode!

A pomodoro web app with features like always on top PIP mode!

Tomodoro A pomodoro web app with always on top mode! Features: Clean UI(Inspired from other pomodoro apps like Pomotroid) Themes Works Offline PIP/Alw

Dec 24, 2022
Releases(v1.0.0)
Owner
Remco Haszing
Open source software developer and metalhead 🤘
Remco Haszing
A simple Prometheus (aggregated) push gateway allowing stateless/serverless workloads, ephemeral and batch jobs to easily expose their metrics.

Serverless Prometheus (aggregated) Push Gateway A simple Prometheus (aggregated) push gateway allowing stateless/serverless workloads, ephemeral and b

Adam Janiš 17 Dec 4, 2022
Standartized way to expose and use Obsidian Inter-Plugin APIs

Obsidian Plugin API Standartized way of exposing and using Obsidian Plugin APIs Installation npm install --save-dev @vanakat/plugin-api Usage This mod

null 2 Jun 23, 2022
Input a list of Handshake top-level domains, outputs names sorted into 4 arrays: available, registered, reserved, or invalid.

name-check A simple NodeJS package that, given a flat list of top-level domain names, queries the Handshake (HNS) blockchain in order to classify each

Neel Yadav 2 Jan 8, 2022
🌐 How well do you know your top-level domains (TLDs)?

TLD-quiz How well do you know your top-level domains (TLDs)? Sure, you know .com and .net. It's not your first time on the Web. You might even know .i

Andrew Healey 4 Apr 27, 2022
🚀 Using top-level await in AWS Lambda with TypeScript, esbuild and Serverless Framework

?? Top-level await in AWS Lamba with TypeScript Articles https://dev.to/oieduardorabelo/top-level-await-in-aws-lamba-with-typescript-1bf0 https://medi

Eduardo Rabelo 17 Nov 23, 2022
This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usable in Tumult Hype 4 based on your Photoshop document.

Export To Hype (Photoshop Edition) This Photoshop script exports all top-level layers and groups to cropped PNG and JPEG files and creates a file usab

Max Ziebell 6 Nov 9, 2022
A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

A lightweight, performant, and simple-to-use wrapper component to stick section headers to the top when scrolling brings them to top

Mayank 7 Jun 27, 2022
solana-base-app is a base level, including most of the common features and wallet connectivity, try using `npx solana-base-app react my-app`

solana-base-app solana-base-app is for Solana beginners to get them up and running fast. To start run : run npx solana-base-app react my-app change th

UjjwalGupta49 33 Dec 27, 2022
Medusa on steroid, take your medusa project to the next level with some badass features 🚀

medusa-extender Full documentation website Medusa on steroid, take your medusa project to the next level with some badass features ?? The extender pro

Adrien de Peretti 200 Jan 3, 2023
Desenvolvimento do projeto Proffy para Web e mobile, na segunda Next Level Week

Tecnologias | Projeto | Layout | Licença ?? Tecnologias Esse projeto foi desenvolvido com as seguintes tecnologias: Node.js React React Native Expo ??

Laciene Alves Melo 2 Jun 12, 2022