🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@nestjsplus/dyn-schematics

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjsplus/dyn-schematics

NestJS Dynamic Module Schematics for @nestjs/cli

Source
npmnpm
Version
1.0.10
Version published
Weekly downloads
1.9K
-4.7%
Maintainers
1
Weekly downloads
 
Created
Source

Nest Logo

NestJS CLI Schematics for Dynamic Module Generation

Overview

This package contains a set of NestJS CLI schematics for generating modules that can be dynamically configured. The concepts behind the generated code is covered in detail in this article

Installation

Install the package globally as shown below. Due to the implementation of the NestJS CLI, the package must be global.

npm install -g @nestjsplus/dyn-schematics

Dynamic Package Generation

Currently, the primary use case supported is scaffolding a package containing a dynamic module. Such a package can easily be installed with npm, or packaged and distributed via the npm registry, or a private registry. In other words, a re-usable library. I'm also working on versions of the schematic to

  • build a dynamic module within an existing NestJS application
  • adding components to a dynamic module, such as additional options providers

Generate a new standalone dynamic package that will contain the customized skeleton of a dynamic module with:

nest g -c @nestjsplus/dyn-schematics dynpkg <pkg-name>

  • dynpkg is the name of the schematic to generate a standalone package containing a dynamic module.
  • <pkg-name> is the name of the new package you're building.

Move to the sub-folder just created:

cd <pkg-name> where pkg-name is the name you supplied in the original nest g command above.

Install the dependencies for the generated package:

npm install

Verify generated package

If you answered yes to the promptGenerate a testing client?, a small testing module was automatically generated called ClientModule. You can test that the template was properly generated by running

npm run start:dev

Then connect to http://localhost:3000. Your browser should display Hello from <pkg-name>Module!.

Customizing

The files in the project have comments that should help guide you.

You can also refer to this article for details on the concepts behind this module pattern.

Change Log

See Changelog for more information.

Contributing

Contributions welcome! See Contributing.

Author

John Biundo (Y Prospect on Discord)

License

Licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 21 Sep 2019

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