node-zoom2
Version:
z39.50 with Node 12+ support
22 lines (20 loc) • 853 B
JavaScript
var zoom = require('../lib');
zoom.connection('www.yuntsg.net:2100/calis')
.set('user', 'aizhi')
.set('password', '579012')
.set('preferredRecordSyntax', 'unimarc')
.query('prefix', '@attr 1=7 ' + '9787508690254')
.search(function (err, resultset) {
resultset.getRecords(0, resultset.size, function (err, records) {
while (records && records.hasNext()) {
var record = records.next();
console.log(record.render); // this is garbled
console.log(record.get('render;charset=gb2312')) // this renders correctly
console.log(record.xml); // this is garbled
console.log(record.get('xml;charset=gb2312')) // this renders correctly
console.log(record.json); // this is garbled
console.log(record.get('json;charset=gb2312')) // this renders correctly
}
});
});
;