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.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
increased by22.22%
Maintainers
1
Weekly downloads
 
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 main(){
  ...

  // create a generator instance
  const s = scaffe.generate(templateDir, outDir, { overwrite: true, variables: { name: "app" } })

  // add a file from outside the templateDir
  // the source path should be relative to templateDir
  s.add("../common/logo.png", "assets/logo.png")

  // add multiple files using glob pattern to the target project directory
  // the source path should be relative to templateDir
  s.add("../common/styles/*.scss", "static/css/")

  // ignore certain files
  s.ignore("docs/**/*.scss")

  // ignore certain folder
  s.ignore("build/**/*")

  try {
    await s;
  } catch(err) {
    console.log(err)
  }
}

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.

MORE ON USING SCAFFE

Keywords

FAQs

Package last updated on 04 Nov 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