Comparing version 0.0.5-a to 0.1.0
{ | ||
"name": "ferrum", | ||
"description": "Framework for node.js", | ||
"version": "0.0.5a", | ||
"author": "Sergey Zvinsky <s.zvinsky@gmail.com>", | ||
"contributors": [ | ||
{ "name": "Sergey Zvinsky", "email": "s.zvinsky@gmail.com" } | ||
], | ||
"keywords": [ | ||
"ferrum", | ||
"framework", | ||
"web" | ||
], | ||
"repository": "git://github.com/sergez/ferrum.git", | ||
"engines": { "node": "*" }, | ||
"directories": { | ||
"lib": "./lib", | ||
"test": "./test" | ||
"version": "0.1.0", | ||
"description": "", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": " nyc --reporter=text --reporter=lcov --check-coverage --branches 90 --statements 90 --lines 90 mocha", | ||
"lint": "./node_modules/.bin/eslint src test", | ||
"junit": "mocha --exit -R mocha-junit-reporter", | ||
"preversion": "npm run junit", | ||
"postversion": "git push origin master --follow-tags", | ||
"delete-git-tag": "git tag -d v$npm_package_version && git push origin :v$npm_package_version", | ||
"doc": "jsdoc -c .jsdoc.json" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/adobe/ferrum" | ||
}, | ||
"author": "", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/adobe/ferrum/issues" | ||
}, | ||
"homepage": "https://github.com/adobe/ferrum#readme", | ||
"dependencies": { | ||
"winston": ">=0.6.2", | ||
"qs": ">=0.5.3", | ||
"formidable": ">=1.0.11", | ||
"cookies": ">=0.3.5", | ||
"keygrip": ">=0.2.2", | ||
"dustjs-linkedin": ">=1.0.0" | ||
"lodash": "4.17.11" | ||
}, | ||
"devDependencies": { | ||
"vows": "0.6.x", | ||
"needle": "0.4.8" | ||
"ajv": "^6.10.0", | ||
"codecov": "^3.5.0", | ||
"docdash": "git+https://github.com/koraa/docdash.git", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb": "^17.1.0", | ||
"eslint-plugin-header": "^3.0.0", | ||
"eslint-plugin-import": "^2.17.3", | ||
"eslint-plugin-jsx-a11y": "^6.2.1", | ||
"eslint-plugin-react": "^7.13.0", | ||
"jsdoc": "^3.6.2", | ||
"junit-report-builder": "^1.3.2", | ||
"mocha": "^6.1.4", | ||
"mocha-junit-reporter": "^1.23.0", | ||
"mocha-parallel-tests": "^2.2.0", | ||
"nyc": "^14.1.1" | ||
}, | ||
"scripts": { | ||
"test": "vows --spec --isolate" | ||
}, | ||
"main": "./lib/index" | ||
} | ||
"snyk": true | ||
} |
138
README.md
@@ -1,137 +0,1 @@ | ||
Ferrum [alfa] [![Build Status](https://travis-ci.org/sergez/ferrum.png?branch=master)](ferrum) | ||
========= | ||
What is it? | ||
----------- | ||
Ferrum is simple and powerful framework for [node.js](http://nodejs.org). It's designed for quick and simple development of high-performance application. Ferrum don't force you to organize your code how it wants - it's up to you and i suppose it gives some flexibility in development of apps. | ||
Instalation | ||
----------- | ||
`npm install ferrum` | ||
Hello, word | ||
----------- | ||
Here is an example of Ferrum app: | ||
```js | ||
var util = require('util'); | ||
var ferrum = require('ferrum'); | ||
function MainHandler () { | ||
ferrum.RequestHandler.call(this); | ||
this.get = function () { | ||
this.write("Hello, world!"); | ||
}; | ||
} | ||
util.inherits(MainHandler, ferrum.RequestHandler); | ||
ferrum.Application({ | ||
routes: { | ||
'^/$': MainHandler | ||
} | ||
}).run(); | ||
``` | ||
Then type http://localhost:8888 in browser address bar and enjoy. | ||
Usage | ||
----- | ||
* [Request handlers and arguments](#request-handlers-and-arguments) | ||
* [Query params](#query-params) | ||
Request handlers and arguments | ||
------------------------------ | ||
In Ferrum application every URL or URL expression corresponds to handler based on `ferrum.RequestHandler`. This handler contains methods for processing GET, POST and others of http requests. | ||
Allowed http-methods and appropriate ferrum methods are: | ||
* GET > get() | ||
* POST > post() | ||
* PATCH > patch() | ||
* PUT > put() | ||
* DELETE > del() | ||
* HEAD > head() | ||
* OPTIONS > options() | ||
In following example the root path `/` points to MainHandler and the URL expression `/user/([0-9]+)` to UserHandler. Apart of that regular expression groups are passed as arguments to UserHandler handler. | ||
``` | ||
function MainHandler () { | ||
ferrum.RequestHandler.call(this); | ||
this.get = function () { | ||
... | ||
}; | ||
} | ||
util.inherits(MainHandler, ferrum.RequestHandler); | ||
fuction UserHandler () { | ||
ferrum.RequestHandler.call(this); | ||
this.get = function (userId) { | ||
... | ||
}; | ||
} | ||
util.inherits(UserHandler, ferrum.RequestHandler); | ||
ferrum.Application({ | ||
routes: { | ||
'^/$': MainHandler, | ||
'^/user/([0-9]+)$': UserHandler | ||
} | ||
}).run(); | ||
``` | ||
Query params | ||
------------ | ||
To work with query paramenters ferrum use third-party component [qs](https://npmjs.org/package/qs). The result of parsing query string is available in `ferrum.Request` object. | ||
``` | ||
// GET http://localhost/params?params1=value1¶ms2=value2 | ||
function ParamsHandler, () { | ||
ferrum.RequestHandler.call(this); | ||
this.get = function () { | ||
this.write(JSON.stringify(this.request.query)); | ||
// => {"params1":"value1","params2":"value2"} | ||
}; | ||
} | ||
util.inherits(ParamsHandler, ferrum.RequestHandler); | ||
ferrum.Application({ | ||
routes: { | ||
'^/params$': ParamsHandler | ||
} | ||
}).run(); | ||
``` | ||
License | ||
------- | ||
The MIT License (MIT) | ||
Copyright (c) 2012 Sergey Zvinsky s.zvinsky@gmail.com | ||
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. | ||
# Ferrum |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 20 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
3049504
1
154
7448
1
0
15
2
21
+ Addedlodash@4.17.11
+ Addedlodash@4.17.11(transitive)
- Removedcookies@>=0.3.5
- Removeddustjs-linkedin@>=1.0.0
- Removedformidable@>=1.0.11
- Removedkeygrip@>=0.2.2
- Removedqs@>=0.5.3
- Removedwinston@>=0.6.2
- Removed@colors/colors@1.6.0(transitive)
- Removed@dabh/diagnostics@2.0.3(transitive)
- Removed@types/triple-beam@1.3.5(transitive)
- Removedanymatch@3.1.3(transitive)
- Removedasap@2.0.6(transitive)
- Removedasync@3.2.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbinary-extensions@2.3.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbraces@3.0.3(transitive)
- Removedcall-bind@1.0.8(transitive)
- Removedcall-bind-apply-helpers@1.0.1(transitive)
- Removedcall-bound@1.0.2(transitive)
- Removedchokidar@3.6.0(transitive)
- Removedcli@1.0.1(transitive)
- Removedcolor@3.2.1(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedcolor-string@1.9.1(transitive)
- Removedcolorspace@1.1.4(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcookies@0.9.1(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddepd@2.0.0(transitive)
- Removeddezalgo@1.0.4(transitive)
- Removeddunder-proto@1.0.0(transitive)
- Removeddustjs-linkedin@3.0.1(transitive)
- Removedenabled@2.0.0(transitive)
- Removedes-define-property@1.0.1(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedexit@0.1.2(transitive)
- Removedfecha@4.2.3(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfn.name@1.1.0(transitive)
- Removedformidable@3.5.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedfsevents@2.3.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.6(transitive)
- Removedglob@7.2.3(transitive)
- Removedglob-parent@5.1.2(transitive)
- Removedgopd@1.2.0(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-symbols@1.1.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhexoid@2.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-arrayish@0.3.2(transitive)
- Removedis-binary-path@2.1.0(transitive)
- Removedis-extglob@2.1.1(transitive)
- Removedis-glob@4.0.3(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedkeygrip@1.1.0(transitive)
- Removedkuler@2.0.0(transitive)
- Removedlogform@2.7.0(transitive)
- Removedmath-intrinsics@1.0.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedms@2.1.3(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedonce@1.4.0(transitive)
- Removedone-time@1.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedqs@6.13.1(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedreaddirp@3.6.0(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsafe-stable-stringify@2.5.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedside-channel@1.1.0(transitive)
- Removedside-channel-list@1.0.0(transitive)
- Removedside-channel-map@1.0.1(transitive)
- Removedside-channel-weakmap@1.0.2(transitive)
- Removedsimple-swizzle@0.2.2(transitive)
- Removedstack-trace@0.0.10(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtext-hex@1.0.0(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removedtriple-beam@1.4.1(transitive)
- Removedtsscmp@1.0.6(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwinston@3.17.0(transitive)
- Removedwinston-transport@4.9.0(transitive)
- Removedwrappy@1.0.2(transitive)