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

@plugcore/core

v1.4.12

Published

plugcore.com core utilities

Downloads

109

Readme

plugcore.com

@plugcore/core

https://nodei.co/npm/@plugcore/core.png?downloads=false&downloadRank=false&stars=false

Documentation can be found at the wiki.

The target of this framework is to help in all the needs of a full featured API REST, from top to bottom, and at the same time having the best possible performance and security.

Internally uses a custom dependency injection system to help with with the project architecture, and all the related modules such as API creation, database connection, etc, is integrated with this system. The dependency injector uses Typescript classes and decorators.

The API implementation is based on Fastify in order to create a lightweight server, and at the moment it only has a MongoDB connector as a database implementation, but support for other databases is on the way.

You are currently in the English :gb: documentation, it's also available in the following languages:

Packages

Currently it's divided in the following packages:

  • @plugcore/core: Contains the core functionalities such as the dependency injector, logs, object validator and mapping, tests framework, cli, project configuration, etc.
  • @plugcore/web: Adds all the needed libraries to publish a REST API
  • @plugcore/ds-mongodb: MongoDB connector integrated the dependency injection and configuration systems.
  • @plugcore/ds-email: Email connector integrated the dependency injection and configuration systems.

Installation

The easiest way to start is to initialize the framework in a folder, usually a recently create GIT Repository that has been cloned:

mkdir myproject
- or -
git clone https://server.com/git/myproject.git

Now we simply have to execute the following

cd myproject
npx @plugcore/core init

Some questions will be prompted to determine the needs of the project, if this is your first time we recommend you to create a little demo with an in memory database mocking a MongoDB server, this will let us immediately start the server and start checking the basic functionalities of the framework.

Do you want to create a basic demo with API REST and a MongodDB client? (y/yes): yes
Do you want to use an in memory database mocked as MongoDB for development or tests purposes? (y/yes): yes

After the installation has finished, we will have a folder structure that looks like this:

myproject/                                -- Project folder
    ├── configuration/                    -- Folder to store all our configuration files
    │    ├── configuration.json           -- Default configuration file
    │    └── configuration.pro.json       -- Properties to override while production mode is activated
    ├── src                               -- Source files of the project
    │   ├── configuration                 -- Folder for the configuration types
    │   │   └── custom.configuration.ts   -- Interface for our custom configuration
    │   └── example                       -- Example entity folder, everything related to Example will be stored here
    │       ├── example.api.ts            -- File to store all our Example API definitions for input/output objects
    │       ├── example.controller.ts     -- API Rest controller that defines all the routes for Example
    │       ├── example.service.ts        -- Service that is connected to a MongoDB to make CRUD operations in the example collection
    │       └── example.shared.ts         -- All the interfaces, types, enums, etc. shared between the project of the entity Example
    ├── test                              -- Folder where we are going to store all of our test services
    │   └── example                       -- Folder for the tests related to the Example entity
    │       └── example-service.test.ts   -- Test service for src/example/example.service.ts
    ├── node_modules/                     -- NPM node_modules
    ├── package.json                      -- NPM package.json, with all the required dependencies and scripts
    └── tsconfig.json                     -- Typescript configuration file

And we can already execute one of the predefined commands to start the project:

npm start

Or if we want to start it in development mode, which will compile and restart the server automatically every time we make some changes, we can execute:

npm run dev

Now we can go to http://localhost:3000/api/documentation to see and test our created services.