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

pri

Package Overview
Dependencies
Maintainers
8
Versions
848
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pri

**Pri** is a toolkit for building web applications with React. **Helps you deal with everything with develop, so you can focus on the business logic.**

  • 4.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
149
increased by36.7%
Maintainers
8
Weekly downloads
Β 
Created
Source

Pri Β· npm version

Pri is a toolkit for building web applications with React. Helps you deal with everything with develop, so you can focus on the business logic.

Features

Pri can help you develop project and component.

  • 🌱 Auto router. File-based routing out of the box.
  • πŸ“ Mdx support. Write markdown page easily, just create a file using .md or .mdx as suffixes.
  • πŸŽ‰ Static export. Very easy to deploy to github pages.
  • πŸ”’ Mocks. Using service worker to mock request!
  • πŸ“„ WebUI. You can create page, or config files by click button in webui!
  • πŸš€ Dynamic Import. Automatic page level dynamic routing.
  • πŸ”₯ Typescript. 100% typescript source code, for project maintainability considerations, only TS projects are supported!
  • πŸ›οΈ Configuration file auto creator. Never worry about configuration files and updates of configuration files. This is automatic.
  • πŸš„ Auto dll. Speed up hot loader.
  • πŸ”Œ Pluginable. 20+ built-in plugins, and more community plug-ins.
  • 0️⃣ Zero-config.

see Docs

Using pri

Pri is used as a npm package installed in your project.

# 1. Create an empty folder, install pri locally.
$ npm i pri --save # /workspace/my-empty-folder

# 2. Init project files, and you will have following npm scripts.
$ npx pri init # Choose project or component.

# Start dev server
$ npm start

# Start docs server
$ npm run docs

# Build
$ npm run build

# Test
$ npm test
Read more npm scripts.
# Preview of production environment
$ npm run preview

# See bundle size analyse
$ npm run analyse

# Bundle to one file
$ npm run bundle

# Format all sources code
$ npm run format

Using pri plugin

Installing the pri plugin into the project will take effect.

For example, using pri-plugin-dob:

npm i pri-plugin-dob --save

# Now all plugin works
npm start

File Structure

Project:

.
β”œβ”€β”€ .temp                     # Gitignored. Temporary file folder.
β”œβ”€β”€ coverage                  # Gitignored. Code coverage folder.
β”œβ”€β”€ dist                      # Gitignored. Dist folder, auto generated by `npm run build`.
β”œβ”€β”€ tests                     # Tests folder.
β”œβ”€β”€ src                       # Source files folder.
β”‚   β”œβ”€β”€ pages                 # Page files.
β”‚   β”œβ”€β”€ layouts               # Layout files.
β”‚   β”œβ”€β”€ components            # Component files.
β”‚   └── utils                 # Util files.
│── priconfig.json            # Config file.
└── ...other-files            # Auto generated by `npx pri init`.

Component:

.
β”œβ”€β”€ .temp                     # Gitignored. Temporary file folder.
β”œβ”€β”€ coverage                  # Gitignored. Code coverage folder.
β”œβ”€β”€ dist                      # Gitignored. Dist folder, auto generated by `npm run build`.
β”œβ”€β”€ tests                     # Tests folder.
β”œβ”€β”€ src                       # Source files folder. Anything here.
│── priconfig.json            # Config file.
└── ...other-files            # Auto generated by `npx pri init`.

Inspired

Q&A

Using in windows

fedora. Using windows subsystem for Linux.

Migrate from 0.x/1.x to 2.x

Two steps:

  1. Run npx pri-migrate-one-to-two in your project root path.
  2. Reinstall node_modules.

FAQs

Package last updated on 16 Feb 2023

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