> For the complete documentation index, see [llms.txt](https://soufatn.gitbook.io/rxjs-book/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://soufatn.gitbook.io/rxjs-book/summary/rxjs_bindings/node/callback_handlers/from_node_callback.md).

# fromNodeCallback

## `Rx.Node.fromNodeCallback(func, [scheduler], [context])` <a href="#rxnodefromnodecallbackfunc-scheduler-context" id="rxnodefromnodecallbackfunc-scheduler-context"></a>

[#](/rxjs-book/summary/rxjs_bindings/node/callback_handlers/from_node_callback.md#rxnodefromcallbackfunc-scheduler-context) [Ⓢ](https://github.com/Reactive-Extensions/RxJS/blob/master/rx.node.js#L41-L43)

**Deprecated in favor of `Rx.Observable.fromNodeCallback` in rx.async.js.**

Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.

### Arguments

1. `func` *(Function)*: Callback function which must be in function (err, ...) format.
2. `[scheduler = Rx.Scheduler.timeout]` *(Scheduler)*: Scheduler used to execute the callback.
3. `[context]` *(Any)*: The context to execute the callback.

### Returns

*(Function)*: An function which when applied, returns an observable sequence with the callback arguments as an array.

### Example

```javascript
var fs = require('fs');
var Rx = require('Rx');

var source = Rx.Node.fromNodeCallback(fs.stat)('file.txt');

var observer = Rx.Observer.create(
    function (x) {
        var stat = x[0];
        console.log('Next: ' + stat.isFile());
    },
    function (err) {
        console.log('Error: ' + err);   
    },
    function () {
        console.log('Completed');   
    }
);

var subscription = source.subscribe(observer);

// => Next: true
// => Completed
```
