Git Product home page Git Product logo

lighter's Introduction

NPM Version Downloads Build Status Code Coverage Dependencies Support

TL;DR

Lighter Common is a set of tools for maintaining Lighter.io standards, plus a collection of libraries that are shared by Lighter.io modules.

Quick Start

Install lighter-common globally:

npm install -g lighter-common

Use lighter-common

lighter-common help
lighter-common import
lighter-common sync

Acknowledgements

We would like to thank all of the amazing people who use, support, promote, enhance, document, patch, and submit comments & issues. Lighter Common couldn't exist without you.

Additionally, huge thanks go to Goin’ for employing and supporting Lighter Common project maintainers, and for being an epically awesome place to work (and play).

MIT License

Copyright (c) 2014 Sam Eubank

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

How to Contribute

We welcome contributions from the community and are happy to have them. Please follow this guide when logging issues or making code changes.

Logging Issues

All issues should be created using the new issue form. Please describe the issue including steps to reproduce. Also, make sure to indicate the version that has the issue.

Changing Code

Code changes are welcome and encouraged! Please follow our process:

  1. Fork the repository on GitHub.
  2. Fix the issue ensuring that your code follows the style guide.
  3. Add tests for your new code, ensuring that you have 100% code coverage. (If necessary, we can help you reach 100% prior to merging.)
    • Run npm test to run tests quickly, without testing coverage.
    • Run npm run cover to test coverage and generate a report.
    • Run npm run report to open the coverage report you generated.
  4. Pull requests should be made to the master branch.

Contributor Code of Conduct

As contributors and maintainers of Lighter Common, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

If any participant in this project has issues or takes exception with a contribution, they are obligated to provide constructive feedback and never resort to personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, edits, issues, and other contributions that are not aligned with this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.

We promise to extend courtesy and respect to everyone involved in this project regardless of gender, gender identity, sexual orientation, ability or disability, ethnicity, religion, age, location, native language, or level of experience.

lighter's People

Contributors

alfredkam avatar arthurkam avatar dangerrangerous avatar hasarthur avatar rexk avatar zerious avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lighter's Issues

Request Logging

Currently, I do not see any request logger.
System logger is currently present using cedar. (with error tracer)

Currently express framework's main performance bottlenecks are

  1. dev template rendering from file system (can be solved by caching and grunt compiler)
  2. request logger

lighter and ltl is doing very effective job in terms of rendering part, but I am now worried performance after attaching logger.

Models

Probably use Sequelize.

Stringify for date objects

Lighter is currently converting a date object into a string, please update stringify to allow ltl to work on it as a date object.

Controller scope middleware support

I would like to have middleware support in controller level.
This feature is particularly useful for controller scope filters like api authentication using api_key or session_token and etc....

suggested syntax:

// express middleware style
var auth = function (req, res, next) {
   ... do something then call (next);
}
module.exports = Controller.extend({

  // pass controller method as an array if middleware is desired
  index: [auth, function GET(request, response) {
    response.view('index');
  }],

  // Conventional lighter way still works
  index2: function GET(req, res) {
       // do something
  },

  // anonymous middleware definition
  index3: [function (req, res, next) {
      console.log('I am anonymous middleware');
      next();
  }, function POST (req, res) {
  }]
});

Last element of an array describes desired http method type.
I have pushed the change into my forked repo, but I want @zerious's opinion about this, and also I do not know how to handle the error, so just threw it please let me know if that is ok.

https://github.com/RexK/lighter/blob/master/lib/Controller.js

Split HTTP helpers out into Webby

Express can be used interchangeably with Lighter's builtin routing. The builtin routing could be module-ized as Webby so as to reduce Lighter's surface area.

Ability to create requestListener

Correct me if I am wrong.

If there is a way to get requestListener which cam be passed to http.createServer method, it will be a great add-on.

This will make lighter framework compatible of rest of NodeJS deployment.

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.