DailyJS

DailyJS

The JavaScript blog.


Tagbitcoin
Featured

libraries bitcoin

BitcoinJS 1.0

Posted on .

BitcoinJS 1.0 (GitHub: bitcoinjs / bitcoinjs-lib, License: MIT, npm: bitcoinjs-lib) has been released. This is a library for working with Bitcoins. For example, Bitcoin.ECKey.makeRandom can be used to generate a new address, and you can create transactions with new Bitcoin.Transaction().

The API is clean and easy to learn, and it comes with a test suite. It depends on crypto-js and some modules for working with base 58 encoding. Typed arrays are used to ensure it has solid performance.

BitcoinJS is a popular module, and is used by some popular Bitcoin-related services, including Hive Wallet, Blockchain.info, and BitAddress.

It comes with support for browsers, so you can use it in client-side code as well as Node.

The 1.0 release signifies a milestone that the author has been working on since 2011. For more details, see the 1.0 announcement.

Featured

node apps modules bitcoin

Node Roundup: bitcoinaddress.js, atry, Node Web Modules

Posted on .

bitcoinaddress.js

If you need to take Bitcoin payments on your site, then bitcoinaddress.js (GitHub: miohtama / bitcoinaddress.js, License: MIT, npm: bitcoinaddress) by Mikko Ohtamaa might help. It's a module for handling Bitcoin payments. It can be run as a client-side script, or as a Node module. It allows Bitcoins to be sent, or specific currency amounts based on "fiat" amounts.

It's based around bitcoin: URIs, and allows you to display "Pay from wallet" links on your pages. It also displays QR codes so people can easily make payments using mobile Bitcoin apps.

atry

atry (GitHub: CodeCharmLtd / atry, License: MIT, npm: atry) from Code Charm (Damian Kaczmarek) is an alternative to Node's domain module. The basic idea is to allow exceptions to be caught using an asynchronous API:

atry(function() {  
  setTimeout(function() {
    throw new Error('I am Error');
  }, 10);
}).catch(function(err) {
  console.log('Error:', err);
});

It has an intercept method that returns an "exception safe" callback that you can pass as a callback to asynchronous APIs like fs.readFile.

Node Web Modules

Node Web Modules (GitHub: caio-ribeiro-pereira / node-web-modules, License: MIT) by Caio Ribeiro Pereira is a Node web application that shows a list of popular web frameworks for Node. If you select one of the modules it shows a screenshot and some statistics.

The project is powered by Express and Redis, and it uses the GitHub API. The module list it displays on http://nodewebmodules.com/ is useful for beginners, but you might also like to take a look at the source to see how it works.

Featured

node modules bitcoin mongodb

Node Roundup: Nodemon 1.0, Prana, termcoin, node-bitwise-xor

Posted on .

Nodemon 1.0

Nodemon

I noticed Nodemon 1.0 was released this week (GitHub: remy / nodemon, License: MIT, npm: nodemon). This update includes local and global configuration files, execMap for mapping file extensions to programs, and some changes to the overall architecture of the project. You can now require Nodemon, and tests have been added.

Prana

Prana (GitHub: recidive / prana, License: MIT, npm: prana) by Henrique Recidive is a small framework for Node applications. Prana application objects are EventEmitters, and Prana "types" emit events as well.

It combines an ODM system with a plugin system, and currently persists data to memory or MongoDB. The author has included some examples which you can find in prana/examples, and one of them uses Express. The module's code itself has detailed comments, and the readme is solid too.

termcoin

termcoin (GitHub: chjj / termcoin, License: MIT, npm: termcoin) by Christopher Jeffrey is a terminal Bitcoin client with a command-line interface based on blessed. It requires bitcoind to work, and looks really cool in the screenshots.

node-bitwise-xor

Stanislas Marion sent in node-bitwise-xor (GitHub: czzarr / node-bitwise-xor, License: MIT, npm: bitwise-xor), a module for performing a bitwise XOR on two buffers or strings. It iterates over each element with ^, taking into account the length to ensure each item is changed.

Featured

libraries ui bitcoin

UIkit 2.0, bitcoinprices.js

Posted on .

UIKit

UIKit 2.0

UIKit 2.0 (GitHub: uikit / uikit, License: MIT) is a frontend framework that provides components for layout, navigation, and more complex UI widgets like dropdown replacements. It uses jQuery and FontAwesome. Version 2 has just been released, which has some new features including a Markdown editor that supports syntax highlighting and an extensible toolbar.

There's extensive documentation and a theme tool, so you can have a look at the main features quite easily.

bitcoinprices.js

bitcoinprices.js (GitHub: miohtama / bitcoin-prices, License: MIT) by Mikko Ohtamaa is a client-side library for fetching Bitcoin prices. It supports currency selection, and uses BitcoinAverage as the price API.

BitcoinAverage itself is an open source Python project that monitors multiple exchanges for prices:

Price is a weighted average. Meaning that for every exchange the last trade price and last 24h trading volume is taken, each exchange contributes to the final price only to the extent of it's current trading volume. For a more detailed arithmetics explanation check here.

It's got a nice and simple Bootstrap-based website with graphs and tables.

Featured

APIs node modules bitcoin images

Node Roundup: 0.8, ES6 Modules, Kapitalize, Avatars.io

Posted on .

You can send in your Node projects for review through our contact form or @dailyjs.

Node 0.8

Node 0.8 has been released, and Isaac Schlueter has written up a detailed post with some impressive benchmarks: Node v0.8.0. In terms of compatibility, reports from the community seem positive so far. As always, keeping an eye on the nodejs Google Group is a wise idea to gauge potential issues.

As I've been researching material for the Windows and Node series, I'm excited about the future of cross-platform addons:

GYP was used already in Node v0.6 to build on Windows, but now it defines the build on all platforms. Node is still in the process of migrating external addon modules to GYP, and node-gyp is included with npm. In future releases, node-waf will be officially deprecated.

The REPL has been improved -- long lines now wrap correctly, and built-in modules are automatically loaded without needing a require. For example, typing net will automatically return the net module. There's no magic to this, repl.js now defines a list of built-in modules that are automatically loaded when a command matches one.

Work has already started on 0.9, and Isaac mentions the long talked about HTTP refactoring. However, 0.6 releases will continue to the end of 2012, so don't fret if you're still heavily invested in 0.6.

ES6 Modules: A Simpler Proposal

The ECMAScript Modules Proposal represents a major point of contention in the JavaScript community. Frustrated at discussing it in 140 characters, Isaac Schlueter finally wrote what he really thinks of it all in On ES 6 Modules.

This isn't politics. We're not voting for parties. The goal is to figure out the best API, which is a complex thing. The solution space is wide, and it is naive to reduce it to a boolean prematurely.

The discussion is ongoing, but Brendan Eich responded directly here: ES Modules: suggestions for improvement

Static module systems are static, in dependency prefetching, in binding, and in export vs. import checking.

Kapitalize

Kapitalize (License: MIT, npm: kapitalize) is a Bitcoin client that has a chainable API and supports the Bitcoin API.

var kapitalize = require('kapitalize')()

kapitalize  
.auth('Macintyre', 'mypassword')
.set('host', '127.0.0.1')
.set({
    port:8332
})
.getNewAddress()
.getBalance()

The module includes tests, and documentation can be found in the readme.

Avatars.io

Avatars.io is a new service that makes avatars easier to work with for developers. The Avatars.io client library (License: MIT, npm: avatars.io) by Vadim Demedes is a Node module that works with this service:

AvatarsIO.upload('path/to/image.jpg', function(err, url) {  
  // url is a URL of just uploaded avatar
});

On a related note, Chute (npm: chute) by the same author is a client for Chute, which allows sets of photos to be uploaded and managed using a simple API.