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

promzard

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

promzard

prompting wizardly

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.1M
increased by6.82%
Maintainers
1
Weekly downloads
 
Created

What is promzard?

Promzard is a Node.js module that allows you to create interactive command-line prompts for user input. It is particularly useful for creating configuration files or setting up project templates by asking users a series of questions and then generating the necessary files based on their responses.

What are promzard's main functionalities?

Interactive Prompts

This feature allows you to create interactive command-line prompts by specifying a configuration file. The user is prompted to answer questions, and the responses are used to generate a configuration object.

const promzard = require('promzard');
const path = require('path');

const file = path.resolve(__dirname, 'config.js');
promzard(file).then((result) => {
  console.log('Configuration:', result);
}).catch((err) => {
  console.error('Error:', err);
});

Default Values

You can provide default values for the prompts, which will be used if the user does not provide an input. This is useful for setting up common configurations quickly.

const promzard = require('promzard');
const path = require('path');

const file = path.resolve(__dirname, 'config.js');
const defaults = { name: 'defaultName', version: '1.0.0' };
promzard(file, defaults).then((result) => {
  console.log('Configuration:', result);
}).catch((err) => {
  console.error('Error:', err);
});

Custom Validation

Promzard allows you to add custom validation logic to the user inputs. This ensures that the configuration generated meets certain criteria before it is accepted.

const promzard = require('promzard');
const path = require('path');

const file = path.resolve(__dirname, 'config.js');
const validate = (input) => {
  if (input.name.length < 3) {
    throw new Error('Name must be at least 3 characters long');
  }
  return input;
};
promzard(file, {}, validate).then((result) => {
  console.log('Configuration:', result);
}).catch((err) => {
  console.error('Error:', err);
});

Other packages similar to promzard

FAQs

Package last updated on 13 Jun 2012

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