Skip to content

Commit

Permalink
bclient: first commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Oct 23, 2017
0 parents commit c475396
Show file tree
Hide file tree
Showing 11 changed files with 1,146 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .babelrc
@@ -0,0 +1,11 @@
{
"presets": [
["env", {
"targets": {
"browsers": ["last 2 versions"]
},
"useBuiltins": "usage",
"loose": true
}]
]
}
98 changes: 98 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,98 @@
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 8
},
"root": true,
"rules": {
"array-bracket-spacing": ["error", "never"],
"arrow-parens": ["error", "as-needed", {
"requireForBlockBody": true
}],
"arrow-spacing": "error",
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"camelcase": ["error", {
"properties": "never"
}],
"comma-dangle": ["error", "never"],
"consistent-return": "error",
"eol-last": ["error", "always"],
"eqeqeq": ["error", "always", {
"null": "ignore"
}],
"func-name-matching": "error",
"indent": ["off", 2, {
"SwitchCase": 1,
"CallExpression": {
"arguments": "off"
},
"ArrayExpression": "off"
}],
"handle-callback-err": "off",
"linebreak-style": ["error", "unix"],
"max-len": ["error", {
"code": 80,
"ignorePattern": "function \\w+\\(",
"ignoreUrls": true
}],
"max-statements-per-line": ["error", {
"max": 1
}],
"new-cap": ["error", {
"newIsCap": true,
"capIsNew": false
}],
"new-parens": "error",
"no-buffer-constructor": "error",
"no-console": "off",
"no-extra-semi": "off",
"no-fallthrough": "off",
"no-func-assign": "off",
"no-implicit-coercion": "error",
"no-multi-assign": "error",
"no-multiple-empty-lines": ["error", {
"max": 1
}],
"no-nested-ternary": "error",
"no-param-reassign": "off",
"no-return-assign": "error",
"no-return-await": "off",
"no-shadow-restricted-names": "error",
"no-tabs": "error",
"no-trailing-spaces": "error",
"no-unused-vars": ["error", {
"vars": "all",
"args": "none",
"ignoreRestSiblings": false
}],
"no-use-before-define": ["error", {
"functions": false,
"classes": false
}],
"no-useless-escape": "off",
"no-var": "error",
"nonblock-statement-body-position": ["error", "below"],
"padded-blocks": ["error", "never"],
"prefer-arrow-callback": "error",
"prefer-const": ["error", {
"destructuring": "all",
"ignoreReadBeforeAssign": true
}],
"prefer-template": "off",
"quotes": ["error", "single"],
"semi": ["error", "always"],
"spaced-comment": ["error", "always", {
"exceptions": ["!"]
}],
"space-before-blocks": "error",
"strict": "error",
"unicode-bom": ["error", "never"],
"valid-jsdoc": "error",
"wrap-iife": ["error", "inside"]
}
}
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
build/
node_modules/
npm-debug.log
package-lock.json
10 changes: 10 additions & 0 deletions .npmignore
@@ -0,0 +1,10 @@
.git*
bench/
docs/
build/
src/
test/
node_modules/
binding.gyp
npm-debug.log
package-lock.json
19 changes: 19 additions & 0 deletions Makefile
@@ -0,0 +1,19 @@
all:
@npm run browserify

browserify:
@npm run browserify

webpack:
@npm run webpack

clean:
@npm run clean

lint:
@npm run lint

test:
@npm test

.PHONY: all browserify webpack clean lint test
22 changes: 22 additions & 0 deletions README.md
@@ -0,0 +1,22 @@
# bclient

REST and RPC clients for bcoin.

## Usage

``` js
const bcurl = require('bclient');

```

## Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code
to be distributed under the MIT license. You are also implicitly verifying that
all code is your original work. `</legalese>`

## License

- Copyright (c) 2017, Christopher Jeffrey (MIT License).

See LICENSE for more info.
16 changes: 16 additions & 0 deletions lib/bclient.js
@@ -0,0 +1,16 @@
/*!
* bclient.js - http clients for bcoin
* Copyright (c) 2017, Christopher Jeffrey (MIT License).
* https://github.com/bcoin-org/bcoin
*/

'use strict';

const NodeClient = require('./node');
const WalletClient = require('./wallet');

exports.NodeClient = NodeClient;
exports.nodeClient = options => new NodeClient(options);

exports.WalletClient = WalletClient;
exports.walletClient = options => new WalletClient(options);

0 comments on commit c475396

Please sign in to comment.