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

jsx-vanilla-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsx-vanilla-loader

JSX Vanilla loader for Webpack

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

JSX Vanilla

JSX is a JavaScript XML/HTML syntax extender, that allows you to render XML/HTML tags inside vanilla JavaScript. Originaly inspired by React.js JSX

Examples of usage

Here is some examples of JSX Vanilla usage

Basic syntax

	let 
		a = <p>Hello world!</p>,
		b = (<p>Hello world</p>),
		c = (
			<div>
				<p>Hello world!</p>
			</div>
		)
	;
	
	document.body.appendChild(a);
	document.body.appendChild(<p>Hello world!</p>);

Parameters usage

	const 
		text = "Hello world!",
		six = 6
	;
	
	function test() {
		return text;
	}
	
	let 
		a = <p>{text}</p>,
		b = (<p>{(2+2)}</p>),
		c = (<p>{text()}</p>),
		d = (<p>{(six > 5 ? "True" : "False")}),
		e = (
			<p>{(function(){
				return 4 > 2 ? "Four bigger than two" : "Two bigger than four";
			})()}</p>
		)
	;

Cycles examples

const array = ['First', 'Second', 'Third'];

let 
	a = (
		<ul class="menu">
			{array.map(item => (
				<li>{item}</li>
			)).join('')}
		</ul>
	),
	
	b = (
		<ul class="menu">
			{array.forEach(item => {
				return <li>{item}</li>
			})}
		</ul>
	)
;
	

Example of file preprocessing

const 
	JSXVanilla = require('jsx-vanilla'),
	fs = require('fs')
;

fs.readFile('pathToInputFile', 'utf8', function(err, contents) {
   fs.writeFile('pathToOutputFile', JSXVanilla.preprocess(contents), function(err) {
		//other code
   });
});

Keywords

FAQs

Package last updated on 31 Aug 2018

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