Coder Social home page Coder Social logo

javiercorsini / nodetyped Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jamg44/nodetyped

0.0 2.0 0.0 24 KB

Node.js Express Startup Seed with ES6, Typescript, SCSS, EJS, Nodemon, Bootstrap 4, TSLint

License: MIT License

CSS 1.60% TypeScript 98.40%

nodetyped's Introduction

NodeTyped

A Node.js starter kit featuring ES6 with Secuential Asynchrony (async/await), Express (Routing middlewares, Web, Api), Typescript, SCSS, EJS, Nodemon, Bootstrap 4, TSLint.

  • Simple npm setup and maintenance, without grunt/gulp/webpack/...

  • Support for async/await

Example:

async function(req, res, next) {
    let title = 'NodeTyped Express';
    try {
        let data = await readFile(file, 'utf-8'); // no callbacks!
        res.render('index', { title: title, dump: data });
    } catch (e) {
        next(e);
    }
}

Requirements

Make sure you have node version >= 4.0

Clone and Install dependencies

# clone the repo
# --depth 1 removes all but one .git commit history
git clone --depth 1 https://github.com/jamg44/NodeTyped.git projectname

# change directory to your new project
cd projectname

# add required global libraries
npm install typings typescript -g

# install the repo dependencies with npm
npm install

# start the server
npm run watch

Develop

Watch mode

You can start the server in development mode (linter included) with:

npm run watch

Open the browser at:

As you save in your editor, the compiler will rebuild and restart the server.

Other commands

Run the linter manually:

npm run lint

Clean temp folders:

npm run clean

Production / Integration

To run the project in a server you'll want to run the built code instead src version.

# deploy the repo to server and run
npm install
npm start

Recommendations

When requiring from node_modules you must use require:

// require from /node_modules
let express = require('express');

With other module types you can use import (node api, created modules):

import * as fs from 'fs';
import { findConfigFile } from '../lib/utils';

To change project name update package.json

"name": "project_name", <-----
...
"watch": "tsc && DEBUG=project_name2:* ... <-----

TODO

  • Add models (mongoose, sequelize)
  • Add karma/jasmine
  • Add test coverage report
  • Yeoman

License

MIT

nodetyped's People

Contributors

jamg44 avatar rammiro82 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.