Socket
Socket
Sign inDemoInstall

impress

Package Overview
Dependencies
12
Maintainers
4
Versions
718
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    impress

Enterprise application server for Node.js


Version published
Maintainers
4
Install size
377 kB
Created

Changelog

Source

[3.0.6][] - 2023-10-06

  • Fixed static server for windows
  • Fixed restart on EADDRINUSE
  • Fixed unicode content length in JSON serialization
  • Drop node.js 16 and 19, update dependencies

Readme

Source

impress logo ci Status snyk npm downloads/month npm downloads license

Enterprise application server for Node.js: secure, lightweight, interactive, and scalable.

Description

First Node.js server scaled with multithreading and extra thin workload isolation. Optimized for high-intensive data exchange, rapid development, and clean architecture. Provides everything you need out of the box for reliable and efficient backend, network communication with web and mobile clients, protocol-agnostic API, run-time type validation, real-time and in-memory data processing, and reliable stateful services.

Weak sides: not a good choice for content publishing including blogs and online stores, server-side rendering, serving static content and stateless services.

Strong sides: security and architecture for enterprise-level applications, long-lived connections over websocket to minimize overhead for cryptographic handshake, no third-party dependencies.

Quick start

  • See project template: metarhia/Example
  • Start server with node server.js
  • See documentation and specifications

API endpoint example: application/api/example.1/citiesByCountry.js

async ({ countryId }) => {
  const fields = ['cityId', 'name'];
  const where = { countryId };
  const data = await db.select('City', fields, where);
  return { result: 'success', data };
};

You can call it from client-side:

const res = await metacom.api.example.citiesByCountry({ countryId: 3 });

Metarhia and impress application server way

  • Applied code needs to be simple and secure, so we use sandboxing with v8 isolated contexts, worker threads and javascript closures;
  • Domain code should be separated from system code; so we use DDD, layered (onion) architecture, DI, SOLID and GRASP principles, contract-based approach;
  • Impress supports stateful applications with RPC and client-session sticky to servers; microservices, centralized or distributed architecture;
  • No I/O is faster even than async I/O, so we hold state in memory, share it among multiple threads and use lazy I/O for persistent storage;
  • We use just internal trusted dependencies, no third-party npm packages; total Metarhia technology stack size is less than 2mb.

Features

  • Auto API routing, just create endpoint files as an async function;
  • Code live reload with file system watch (when files change on disk);
  • Graceful shutdown and application state recovery after reload;
  • Minimal dependencies and code size;
  • Can scale with multiple threads and servers;
  • Code sandboxing for security and context isolation;
  • Auto module loader with dependency injection for namespaces;
  • Layered architecture out of the box: core, domain, API, client;
  • Utilize multiple CPU cores and serve multiple ports with worker threads;
  • Inter-process communication and shared memory used for state management;
  • State synchronization mechanism with transactions and subscription;
  • Cache server-side executable JavaScript in memory;
  • Rapid API development support: AJAX RPC and Websocket;
  • Serve static files from memory cache;
  • Application configuration (for different named environments);
  • Database access layer for PostgreSQL and relational db schemas;
  • Persistent sessions support with authentication, groups, and anonymous;
  • Multiple protocols: HTTP, HTTPS, WS, WSS;
  • Logging with buffering (lazy write) and rotation (keep logs N days);
  • File utilities: upload, download, streaming;
  • Built-in simple testing framework;
  • Server health monitoring;
  • Built-in data structures validation and preprocessing library;
  • Task scheduling (interval or certain time);
  • Concurrency control: request queue with timeout and size;
  • Execution timeout and error handling;

Requirements

  • Node.js v16.0.0 or later (v18 preferred)
  • Linux (tested on Fedora 36, 37, Ubuntu 18, 20 and 22, CentOS 7, 8, 9)
  • Postgresql 11 or later (v14 preferred)
  • OpenSSL v3 or later (optional, for https & wss)
  • certbot (recommended but optional)

License & Contributors

Copyright (c) 2012-2023 Metarhia contributors. See github for full contributors list. Impress Application Server is MIT licensed. Project coordinator: <timur.shemsedinov@gmail.com>

Keywords

FAQs

Last updated on 05 Oct 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc