1.2.103 • Published 7 years ago

nodame v1.2.103

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Nodame

npm install nodame

CURRENTLY UNSTABLE!!!


Intro

A Node.js framework built on Express 4.0 with some features to help in increasing development productivity. Nodame uses both third-party and private modules.

It supports cross-platform development! You can freely develop your node team project directly on your laptop without needing a VM or anything!


Prerequisites

  • node.js
  • npm -- installed with node.js
  • mocha -- npm install -g mocha (Only if you are going to use the unit testing)

Installation

Installing Nodame is nothing more simpler than executing npm install nodame.

  1. Create project directory

    mkdir ./new_project && cd ./new_project
  2. Create package.json

    npm init
  3. Install nodame package

    npm install --save nodame@~1.1.0

    Check the release updates for the latest stable version.

  4. Build project's files

    ./node_modules/nodame/build.sh

Run application

You can run your application by executing index.js. Your default project can be accessed through your browser at http://localhost:3000/my-project.

P.S.: You might want to set cookie domain to "", NULL, or FALSE; if you are using localhost as your domain. See Cookie Specification.

Run using node command

node index.js [options]
OptionDefaultDescription
-c, --config <file>./config-develConfig file location
-e, --env <env>developmentApplication environment
-S, --stagingSet staging environment
-P, --productionSet production environment
-p, --portSet port
-t, --testRun test

Example:

```bash
node index.js --config ~/config/main.ini
```

Run using nodemon

  1. Install nodemon

    npm install -g nodemon

    This will install nodemon globally

  2. Run nodemon

    nodemon index.js [option]

Release updates

ReleaseVersion
Stable1.1.0
Release candidate-

Changes history

  • 1.0.6
    • Fixed Windows assets issue
  • 1.0.5
    • Fixed Windows path issue
  • 1.0.4
    • Added support to cross-platform development
    • Added nodame/path module
  • 1.0.3
    • Added xml parser support to req.body
  • 1.0.2
    • Added support to session token hook
  • 1.0.1
    • Deprecated nodame.service(), changed to nodame.require('service/')
    • Deprecated nodame.middleware(), changed to nodame.require('middleware/')
    • Deprecated nodame.handler(), changed to nodame.require('handler/')
  • 1.0.0
    • Public release to npm
    • Added hook support to run on system boot
  • 0.2.2
    • Added support to set header in request
    • Added support to post XML in request
    • Fixed assets manager bug
  • 0.2.1
    • Changed self passing variable in config file to {{config.name}}
    • Added support to argv
    • Fixed assets manager bug
  • 0.2.0
    • Added support to self passing variable in config file using %config.name%
    • Added support to URL encode in config file using (config_value|encode_url)
    • Removed support to bower
  • 0.1.0
    • Added support to bower
    • Extracted from team's project

Features

  • TODO: Complete this section.

Routes

  • TODO: Complete this section.

Automates routing as defined in config.

Menu

  • TODO: Complete this section.

Auto-config menu.

Handlers

  • TODO: Complete this section.

Handlers.

Services

  • TODO: Complete this section.

Services.

Middlewares

  • TODO: Complete this section.

Middlewares.

Views

  • TODO: Complete this section.

Views.

Assets manager

  • TODO: Complete this section.

Provides automated assets generation of javascript and stylesheet files for production. It minifies and combines assets as defined in config.

Unit testing

  • TODO: Complete this section.

Unit testing using BDD style.

Public methods

  • TODO: Complete this section.

Public methods are methods or objects that can be ran throughout the environment.

nodame

  • nodame.appPath()
    Return application's absolute path.

    ```javascript
    var appPath = nodame.appPath();
    // return '/absolute/path/to/app'
    ```
  • nodame.argv
    Return argv object

    ```bash
    node index.js --env development
    ```
    
    ```javascript
    var env = nodame.argv.env;
    // return 'development'
    ```
  • nodame.config()
    Return config's value by passing selector. Please see nodame.settings for direct access to config's object.

    ```javascript
    var baseUrl = nodame.config('server.url.base');
    // return server.url.base in config
    ```
  • nodame.enforceMobile()
    Middleware to enforce mobile view. Not to be used in application.

  • nodame.env()
    Return application's environment

    ```javascript
    var env = nodame.env();
    return 'development'
    ```
  • nodame.express() Return new Express' object.

    ```javascript
    var express = nodame.express();
    // return new express' object
    ```
  • nodame.handler(name string) Deprecated in 1.0.1. Please see nodame.require()

  • nodame.isDev() Return whether it's development environment. Production and staging are considered as non-development environment.

    ```javascript
    if (nodame.isDev()) {
        console.log('Hello Dev!');
    }
    ```
  • nodame.locals() Middleware to register locals variable. Not to be used in application.

  • nodame.middleware() Deprecated in 1.0.1. Please see nodame.require()
  • nodame.require(name string) Native's require wrapper. You are encouraged to use this method instead of native's method as the native method won't load npm modules imported by nodame and nodame modules.

    ```javascript
    var path = nodame.require('path');
    // return native's module path
    var request = nodame.require('nodame/request');
    // return nodame module request
    var foo = nodame.require('module/foo');
    // return custom module foo as located in /modules
    ```
  • nodame.router() Return new express.Router().

    ```javascript
    var router = nodame.router();
    // return express.Router()
    ```
  • nodame.service(name string) Deprecated in 1.0.1. Please see nodame.require()

  • nodame.set(name string, obj object) Register object to nodame.settings.__systems. Not to be used in application.
  • nodame.settings Return settings value directly. This is a call to nodame.setting. You can use this to return config value directly by using nodame.settings.config, for calling config indirectly please see nodame.config().

    ```javascript
    var baseUrl = nodame.settings.config.server.url.base;
    // return server.url.base
    ```
  • nodame.sysPath() Return system's path. Not to be used in application.

sprintf

  • sprintf(string format , [mixed arg1 [, mixed arg2 [ ,...]]]) Public method to sprintf

    ```javascript
    var foo = 'wooof';
    var bar = 'booo!';
    var str = sprintf('It sounds like %s but actually %s', foo, bar);
    // return 'It sounds like wooof but actually booo!'
    ```
  • vsprintf() Same as sprintf() but accept arrays.

    ```javascript
    var foo = vsprintf('The first 4 letters of the english alphabet are: %s, %s, %s and %s', ['a', 'b', 'c', 'd']);
    // return 'The first 4 letters of the english alphabet are: a, b, c, d'
    ```

Modules

Nodame comes with third-party modules and private modules which can be used using nodame.require().

Third party modules

NameVersion
async~0.9.0
body-parser~1.10.2
colors~1.0.3
commander~2.8.1
cookie-parser~1.3.3
debug~2.1.1
express~4.11.1
express-device~0.3.11
express-xml-bodyparser~0.0.7
js-sha512^0.2.2
jumphash^0.2.2
log~1.4.0
mandrill-api~1.0.41
md5^2.0.0
measure^0.1.1
method-override~2.3.2
morgan~1.5.2
node-dogstatsd0.0.6
node-uuid~1.4.3
numeral~1.5.3
parse-duration^0.1.1
query-string~1.0.0
raven^0.7.3
redis~0.12.1
serve-static~1.9.2
sprintf-js~1.0.2
swig~1.4.2
validate.js~0.6.1

Private modules

Datadog

Date

File

HTML

JsonApi

Linked

Locale

Mailer

Redis

Request

Secret

Session

String

View

<> with ❤︎ by ドラえもん

1.2.103

7 years ago

1.2.102

7 years ago

1.2.101

7 years ago

1.2.100

7 years ago

1.2.99

7 years ago

1.2.98

7 years ago

1.2.97

7 years ago

1.2.96

7 years ago

1.2.95

7 years ago

1.2.94

7 years ago

1.2.93

7 years ago

1.2.92

7 years ago

1.2.91

7 years ago

1.2.90

7 years ago

1.2.89

7 years ago

1.2.88

7 years ago

1.2.87

7 years ago

1.2.86

7 years ago

1.2.84

7 years ago

1.2.83

7 years ago

1.2.82

7 years ago

1.2.81

7 years ago

1.2.80

7 years ago

1.2.79

7 years ago

1.2.78

7 years ago

1.2.77

7 years ago

1.2.76

7 years ago

1.2.75

7 years ago

1.2.74

7 years ago

1.2.73

7 years ago

1.2.72

8 years ago

1.2.71

8 years ago

1.2.70

8 years ago

1.2.69

8 years ago

1.2.68

8 years ago

1.2.67

8 years ago

1.2.66

8 years ago

1.2.65

8 years ago

1.2.64

8 years ago

1.2.63

8 years ago

1.2.62

8 years ago

1.2.61

8 years ago

1.2.60

8 years ago

1.2.59

8 years ago

1.2.58

8 years ago

1.2.57

8 years ago

1.2.56

8 years ago

1.2.55

8 years ago

1.2.54

8 years ago

1.2.53

8 years ago

1.2.52

8 years ago

1.2.51

8 years ago

1.2.50

8 years ago

1.2.49

8 years ago

1.2.48

8 years ago

1.2.46

8 years ago

1.2.44

8 years ago

1.2.43

8 years ago

1.2.42

8 years ago

1.2.41

8 years ago

1.2.40

8 years ago

1.2.39

8 years ago

1.2.38

8 years ago

1.2.37

8 years ago

1.2.36

8 years ago

1.2.35

8 years ago

1.2.34

8 years ago

1.2.33

8 years ago

1.2.32

8 years ago

1.2.31

8 years ago

1.2.30

8 years ago

1.2.29

8 years ago

1.2.28

8 years ago

1.2.27

8 years ago

1.2.26

8 years ago

1.2.25

8 years ago

1.2.24

8 years ago

1.2.23

8 years ago

1.2.22

8 years ago

1.2.21

8 years ago

1.2.20

8 years ago

1.2.19

8 years ago

1.2.18

8 years ago

1.2.17

8 years ago

1.2.16

8 years ago

1.2.15

8 years ago

1.2.14

8 years ago

1.2.13

8 years ago

1.2.12

8 years ago

1.2.10

8 years ago

1.2.9

8 years ago

1.2.8

8 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.37

9 years ago

1.1.36

9 years ago

1.1.35

9 years ago

1.1.34

9 years ago

1.1.33

9 years ago

1.1.31

9 years ago

1.1.30

9 years ago

1.1.29

9 years ago

1.1.28

9 years ago

1.1.27

9 years ago

1.1.26

9 years ago

1.1.25

9 years ago

1.1.24

9 years ago

1.1.23

9 years ago

1.1.22

9 years ago

1.1.21

9 years ago

1.1.20

9 years ago

1.1.19

9 years ago

1.1.18

9 years ago

1.1.17

9 years ago

1.1.16

9 years ago

1.1.15

9 years ago

1.1.14

9 years ago

1.1.13

9 years ago

1.1.12

9 years ago

1.1.11

9 years ago

1.1.10

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.5

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.41

9 years ago

1.0.40

9 years ago

1.0.39

9 years ago

1.0.38

9 years ago

1.0.37

9 years ago

1.0.36

9 years ago

1.0.35

9 years ago

1.0.34

9 years ago

1.0.33

9 years ago

1.0.32

9 years ago

1.0.31

9 years ago

1.0.30

9 years ago

1.0.28

9 years ago

1.0.27

9 years ago

1.0.26

9 years ago

1.0.25

9 years ago

1.0.24

9 years ago

1.0.23

9 years ago

1.0.22

9 years ago

1.0.21

9 years ago

1.0.20

9 years ago

1.0.19

9 years ago

1.0.18

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.2.2

9 years ago

0.0.1

9 years ago