New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

make-component

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

make-component

Generate virtual-dom components

latest
Source
npmnpm
Version
0.8.0
Version published
Maintainers
1
Created
Source

make-component npm version Build Status

Generate virtual-dom components files

Background / Why?

The less of your application that you need to think about when making changes, the easier it is to build complex features

  • every dom element should have its own file
  • your app's directory tree should mimic your DOM tree
  • given the running web app and the source code, it should be easy to find where to make a change

Todo:

  • Back up / better explain the above
  • Add a Pros and Cons section to this approach
  • Maybe link to a gist explaining how I arrived at building my components this way

In the meantime I recommend using mco some-component-name -d for everything

To Install

$ npm install --save make-component

For the CLI:

$ npm install --global make-component

Usage

API

var makeNode = require('make-component').makeNode
var makeStyle = require('make-component').makeStyle

// component node string
makeNode('component-name')

// component style string
makeStyle('component-name')

CLI

$ mco component-name > ./path/to/dir/component-name.js
$ mco component-name -s > ./path/to/dir/component-name_style.js
$ mco component-name -d # dump out a component folder with the node and its styles

Finding Things

Inspect element and look at the filepath attribute to see exactly where the component's source lives

License

MIT

Keywords

component

FAQs

Package last updated on 27 Jul 2017

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