Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Easy and customizable generator system for creating template.
It provides the following features:
Global
npm install -g hia
Local
npm install -D hia
Example:
---
command: hia
subcommands:
component:
description: generate view template.
input: true
templates:
- name: component/[input]Component.jsx
src: templates/component.ejs
output:
dir: src
args:
text:
aliase: t
description: text on your component.
required: true
Template is resolved as ejs.
import React from 'react';
export default <%= input %> extends React.Component {
render() {
return (
<div>
<h1><%= input %> Component!</h1>
<span><%= text %></span>
</div>
);
}
}
$ hia component Test -t 'Test Text!'
Then, created src/component/TestComponent.jsx on your project root.
src/component/TestComponent.jsx
import React from 'react';
export default Test extends React.Component {
render() {
return (
<div>
<h1>Test Component!</h1>
<span>Test Text!</span>
</div>
);
}
}
Example:
---
basedir: ./test
command: hia
subcommands:
test:view:
description: generate view template.
input: true
templates:
src: fixtures/component.ejs
script:
fixtures/scripts/test.js
output:
dir: test/dist
filename: '[name].jsx'
args:
feature_name:
aliase: f
description: Feature name. It is used as second directory name.(If you specify calendar, create 'test/dist/calendar/[name].jsx')
require_args:
aliase: r
description: require args.
required: true
question_args:
aliase: q
description: This is Question Section.
before: fixtures/scripts/before.js
question: true
default_args:
aliase: d
description: set default value.
default: 'default value'
The base directory for resolving filepaths.
Default: process.cwd()
Your generator system's command name.
Define your generator system's subcommands.
subcommandName become subcommand for cli.
Example:
command: hia
subcommands:
view:
description: generate view template.
input: true
...
Usage
$ hia view hogeView
Description of your subcommand. It is used for help message on cli.
Set whether or not require value of input.
Default: false
src: template src of ejs. name(optional): output src file path based on setting of basedir. [input] or other arg name are replaced by the name of the chunk.
Specify filepath of Node.js script. It runs before rendering and writing templates.
Script Example:
module.exports = function script(params) {
params.subcommand.output.dir += '/exchanged';
params.cliParams.input += 'Exchanged';
return params;
};
It needs runnable on Node.js and must be exported as default.
You can receive bellow parameter and can change included value freely.
Returned value is applied for template rendering and writing.
Example:
$ hia test:view Test --feature_name bar
{
subcommand: {
description: 'generate view template.',
input: true,
templates: { src: 'fixtures/component.ejs' },
script: 'fixtures/scripts/test.js',
output: { dir: 'test/dist', filename: '[name].jsx' },
args: { feature_name: [Object] }
},
cliParams: {
subcommand: 'test:view',
input: 'Test',
args: { feature_name: 'bar' }
}
}
dir: Output directory. Default is basedir.
filename: output file. [name] is replaced by the name of the chunk.
Example:
---
subcommands:
test:view:
...
args:
feature_name:
aliase: f
description: Feature name. It is used as second directory name.(If you specify calendar, create 'test/dist/calendar/[name].jsx')
require_args:
aliase: r
description: require args.
required: true
question_args:
aliase: q
description: This is Question Section.
before: fixtures/scripts/before.js
question: true
default_args:
aliase: d
description: set default value.
default: 'default value'
...
hia has default options.
$ hia-flux -h
Easy and customizable generator system for creating template by cli.
Usage:
hia-flux <SUBCOMMAND> <INPUT>
-h, --help Show list available subcommands and some concept guides.
You can require hia as function.
Example
import 'babel-core/register';
import 'babel-polyfill';
import hia from 'hia';
hia({ basedir: __dirname + '/..', configPath: `${__dirname}/../hia.yml` });
Now you need require 'babel-core/register' and 'babel-polifill' to use it.
hia can be received below option.
MIT © joe-re
FAQs
Easy and customizable generator system for creating template.
The npm package hia receives a total of 0 weekly downloads. As such, hia popularity was classified as not popular.
We found that hia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.