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

@packlify/core

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@packlify/core

A core module of the Packlify ecosystem, `@packlify/core` provides essential utilities and server-side logic for React-based applications.

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@packlify/core

A core module of the Packlify ecosystem, @packlify/core provides essential utilities and server-side logic for React-based applications.

Table of Contents

  • Installation
  • Features
  • Usage
  • Requirements
  • Contact

Installation

npm install @packlify/core

Features

  • Modular server-side rendering for React components.
  • Device-type recognition middleware.
  • Easy to configure with Vite and Express.
  • Types for server-side and client-side logic.

Usage

Import and initialize server

To create an Express server:

import { createServer } from '@packlify/core';

const app = await createServer();

Use device-type recognition middleware

In your server-side logic:

import deviceMiddleware from '@packlify/core/middleware/device';

app.use(deviceMiddleware);

Render a React component

To render a component on the server-side:

import { renderComponent } from '@packlify/core';

const htmlString = renderComponent({
  Component: YourReactComponent,
  url: '/your-url',
  props: { key: 'value' },
  withRouter: true,
});

Commands

  • packlify-build-server: Build server for production.
  • packlify-dev-server: Run development server.
  • packlify-server: Run production server.

Requirements

  • Node.js (+16)
  • NPM or Yarn
  • TypeScript (recommended)
  • Vite
  • Express

Contact

Lucas Farias lukf95@gmail.com LinkedIn - GitHub

FAQs

Package last updated on 26 Nov 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