From e8c88fa7e4f2ad094fb9ea266a1d9663a6e400f5 Mon Sep 17 00:00:00 2001 From: Jerry Yang Jin Date: Wed, 17 May 2017 19:32:27 +0800 Subject: [PATCH] prepare for 1.9.2 --- .npmignore | 25 ++++++++++++++++++++++ LICENSE | 2 +- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++- bower.json | 13 ++++++++++++ package.json | 27 +++++++++++++++++++++++ 5 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 .npmignore create mode 100644 bower.json create mode 100644 package.json diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..4af4952 --- /dev/null +++ b/.npmignore @@ -0,0 +1,25 @@ +*# +node_modules +.DS_STORE +*.swo +*.swp +*.swn +*.swm +*~ +.idea +nbproject +.git +.gitignore +*.o +*.a +*.exe +*.gcda +*.gcno +*.gcov +*.sln +*.suo +*.vc*proj* +*.sdf +*.opensdf +*.aps +mkmf.log diff --git a/LICENSE b/LICENSE index 64338cd..23f2727 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016 QuantLib.JS +Copyright (c) 2016 - 2017 Jerry Jin Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index a4764b4..68dadd7 100644 --- a/README.md +++ b/README.md @@ -1 +1,59 @@ -# quantlibjs \ No newline at end of file +# QuantLib in Pure JavaScript [![npm version](https://badge.fury.io/js/quantlib.js.svg)](http://badge.fury.io/js/quantlib.js) [![Bower version](https://badge.fury.io/bo/quantlib.js.svg)](https://badge.fury.io/bo/qunatlib.js) [![Twitter Follow](https://img.shields.io/twitter/follow/quantlibjs.svg?style=social&maxAge=3600)](https://twitter.com/quantlibjs) + + +> This project is still at very early stage, **DO Expect Bugs** + +> Template classes, enumerations will be added for later + +## Getting started + +```sh +npm install quantlib.js +``` + +or + +```sh +bower install quantlib.js +``` + +### Usage + +#### Load the library + +* Browser + +`$ql will be created after loading js file + +* Node.js + +var $ql = require('quantlib.js'); + +#### Class + +class names are same as [QuantLib](http://quantlib.org/) project. + +use `new` to create object + +```js +// create a new Matrix object +var m1 = new $ql.Matrix({ + "rows:6", + "columns":9 + }); +``` + +```sh +> m1 +Matrix { ptr: 13611328 } +> m1.rows(); +6 +> m1.columns(); +9 +``` + +#### Function Overloading + +Function names are same as QuantLib, and all functions takes one parameter: `opts` + +If function has no paramter, just call it without paramter, otherwise pass a `JSON` object to the function, in this object put `paramter: value` elements, the paramter name must match QuantLib functions. diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..aa07235 --- /dev/null +++ b/bower.json @@ -0,0 +1,13 @@ +{ + "name": "quantlib.js", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "https://github.com/quantlibjs/quantlibjs.git" + }, + "bugs": { + "url": "http://github.com/quantlibjs/quantlibjs/issues" + }, + "author": "Jerry Jin", + "license": "MIT" +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..d69cca4 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "quantlib.js", + "description": "QuantLib in Pure JavaScript", + "version": "0.2.0", + "keywords": [ + "QuantLib" + ], + "main": "lib/quantlib.js", + "repository": { + "type": "git", + "url": "https://github.com/quantlibjs/quantlibjs.git" + }, + "directories": { + "lib": "./lib" + }, + "engines": { + "node": ">= 0.12" + }, + "scripts": { + "prepublish": "npm prune" + }, + "bugs": { + "url": "http://github.com/quantlibjs/quantlibjs/issues" + }, + "author": "Jerry Jin", + "license": "MIT" +}