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

@qrohlf/bones

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qrohlf/bones

A simple Javascript scaffolding tool

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@qrohlf/bones

Bones is a small scaffolding utility for code projects. It runs in node, but can be useful in any kind of project where you find yourself creating the same set of boilerplate files over and over.

Getting Started

  1. Install bones:
npm install -g @qrohlf/bones
  1. Create the .bones folder with an example component template:
cd ~/myproject
bones init
  1. Try it out:
bones component MyComponent
$EDITOR ./MyComponent
  1. Add your own 'bones':
mkdir .bones/mytemplate
vim .bones/mytemplate/__name__.js

Usage

Bones operates on templates that you define in the .bones directory of your project. These templates can be as simple as a single file, or as complex as as set of nested directories.

bones templatename destination [arg1=value arg2=value...]

In filenames, directory names, and template file contents, anything surrounded by double underscores (i.e. __name__) will be replaced with the value you provided on the command line.

The __name__ parameter is populated by default with the basename of the destination argument. You can override this by passing name=YOURNAME as part of the argument list.

There are also a number of string helpers you can use for transforming variables. The syntax for doing this is __name|snakeCase. The currently available helpers are:

helperoutput
camelCasefooBar
pascalCaseFooBar
snakeCasefoo_bar
kebabCasefoo-bar
upperCaseFOOBAR
upperSnakeCaseFOO_BAR
lowerCasefoobar

Bones uses a whitelist to determine which files to run through the template engine and which files to copy. See the default config for a list of file extensions that are interpreted as templates.

Examples

You can see some template examples in the .bones directory of this repo.

Customization

You can set per-project configuration values in .bones/bones.config.js which will override the defaults. See the default config for all of the possible options.

License

Bones is MIT-licensed

Keywords

FAQs

Package last updated on 25 Jul 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

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