New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dot-plop

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-plop

A simple approach to PlopJS with first class TypeScript support and a one-line plopfile

  • 0.4.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

dot-plop

A simple approach to PlopJS with first class TypeScript support and a one-line plopfile.

Installation

$ npm i plop dot-plop -D

Put plopfile.js in your project directory:

module.exports = require('dot-plop')

Usage

  1. Create a new folder in your project directory called .plop.
  2. Write your generators in TypeScript and put them in .plop/generators.
  3. We put our templates in .plop/templates/, but you can put them anywhere you like, just so your generators know where they are.
  4. Write your helpers in TypeScript and put them in .plop/helpers.
  5. Write your Inquirer prompts in TypeScript and put them in .plop/prompts.
  6. Run plop from the command line.

dot-plop will auto discover your generators and helpers. They will have the same name as their export name.

Examples

.plop/generators/my-generator.ts

import { PlopGenerator } from 'plop'

export const units: PlopGenerator = {
  description: 'Feature logic and API integrations',
  prompts: [
    {
      type: 'input',
      name: 'fileName',
      message: 'unit name please',
    },
  ],
  actions: [
    {
      type: 'add',
      path: 'src/units/{{dashCase fileName}}.ts',
      templateFile: '.plop/templates/units/unit.ts.hbs',
    },
    {
      type: 'add',
      path: 'src/units/{{dashCase fileName}}.test.ts',
      templateFile: '.plop/templates/units/unit.test.ts.hbs',
    },
  ],
}

Keywords

FAQs

Package last updated on 13 Mar 2020

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