[go: nahoru, domu]

Skip to content

xdcarter/wantjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WantJS (Web Runtime For CommonJS)

WantJS is Runtime environment include both (server and client) to simplify using with CommonJS in Web. Our goal is to make commonJS more intuitively in Web development,package less in development phase, easily in package splice in production configuration less in bootstrap.

Usage

Create your npm project

mkdir hello-world

cd hello-world

npm init -y

npm install wantjs --save-dev

For example, using React

npm install react react-dom --save

Create index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="root"></div>
</body>
</html>

Create index.jsx

var ReactDom =require('react-dom')
var React =require('react')
var log=require('./app/util/log1')
module.exports=function (){
    log('start ')
    ReactDom.render(
        <h1>Hello world!</h1>,
        document.getElementById('root')
    );
}

Add start script in package.json

  "scripts": {
    "start": "wantjs"
  },

Run cmd

npm run start

server will linsten at 8300,

About

Web Runtime For CommonJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published