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

scaffe

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scaffe

A Scaffolding Utility

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Tests workflow

Simple scaffolding utility, inspired by Sao.js

Installation

$ npm install scaffe # yarn add scaffe

Programmatic Usage

const scaffe = require("scaffe")

async function build(){
  ...
  try {
    await scaffe.generate(templateDir, outDir, { overwrite: true, variables: { name: "app" } });
  } catch(err) {
    console.log(err)
  }

  // OR

  scaffe.generate(templateDir, outDir, { overwrite: true, variables: { name: "app" }).catch((err) => {
    console.log(err);
  })
  
  scaffe.generate(templateDir, outDir, variables, (err) => {
    console.log(err);
  })
}

More Info

The only available function in Scaffe is generate which takes arguments as following in order.

  • templateDir: It's the path to the template directory.
  • outDir: The output directory
  • config: An Object with two props {boolean} overwrite (by default false), {object} variables

Template directory can have two types of files

  • starts with _: this file will be evaluated as an ejs file
  • doesn't starts with _: this type of files will be copied as it is to the output directory.

So we can use variables in our template files in ejs format.

A use case,

// _package.json

{
  "name": "<%= appName %>"
}

variables in 3rd argument (i.e. config) will contain all variable values that need to be passed on to be processed by ejs.

Keywords

FAQs

Package last updated on 10 Apr 2021

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