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

@programmerraj/dev-react

v0.6.0

Published

Develop React components and websites.

Downloads

7

Readme

dev-react

Develop React components and websites.

In Development

This module is still in development and is not yet 1.0.0 in semver. Any minor change can (and probably will) be a breaking change.

Install

You will probably want to save this as a devDependency, which makes sense, because this module is literally called dev-react.

npm i --save-dev @programmerraj/dev-react

ESModules

This package uses ECMAScript Modules

Quick Start

This example shows how to start watching a dir.

File Structure

  • an-input-folder/
    • _common/
    • _index/
    • page/
    • page subpage/
    • ~~a normal file~~
    • ~~_dir/~~
  • output-folder (auto generated)

An input folder is required. It can be named anything. Inside that folder you can create a folder for each page.

A path to an output folder is also required. The output folder will be created if it doesn't exist.

The names of the pages will reflect the path they are served on. For example, a folder called page will be served on /page.

To create subpages, separate them with a space. A folder called page subpage will be /page/subpage.

There are two special folders. Special folders begin with _.

  • _index: Like a normal page, but it is the main page. It will be /.
  • _common: Not a page, but a folder to place files common to multiple pages.

Creating a folder that starts with _ which is not _index or _common will show a warning.

Any normal files in the pages folder will be ignored, and a warning will be shown.

Script

import DevReact from '@programmerraj/dev-react'

const dev = new DevReact({
  inputDir: 'an-input-folder',
  outputDir: 'output-folder'
})
dev.start()

API

The main file default exports the DevReact class.

constructor(options)

  • options
    • inputDir: Path to a directory with pages.
    • outputDir: Path which output files get saved to.

prototype

start()

Start watching the inputDir. Also starts displaying build tasks. For more info about inputDir go to file structure.

  • return: A promise which resolves undefined

stop()

Stops watching the inputDir. Also stops displaying build tasks.

  • return: A promise which resolves undefined