1.
var
bitcore =
require
(
'bitcore'
);
2.
3.
var
Address = bitcore.Address;
4.
5.
var
addr =
new
Address(
"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
);
6.
7.
console.log(addr.isValid());
01.
var
sift =
require
(
'sift'
);
02.
03.
04.
05.
//intersecting arrays
06.
07.
var
sifted = sift({
$in
: [
'hello'
,
'world'
] }, [
'hello'
,
'sifted'
,
'array!'
]);
//['hello']
08.
09.
10.
11.
//regexp filter
12.
13.
var
sifted = sift(/^j/, [
'craig'
,
'john'
,
'jake'
]);
//['john','jake']
14.
15.
16.
17.
18.
19.
//A *sifter* is returned if the second parameter is omitted
20.
21.
var
siftPeople = sift({
22.
23.
24.
25.
//you can also filter against functions
26.
27.
name:
function
(value) {
28.
29.
return
value.length == 5;
30.
31.
}
32.
33.
});
34.
35.
36.
37.
//filtered: [{ name: 'craig' }]
38.
39.
siftPeople([{
40.
41.
name:
'craig'
,
42.
43.
},
44.
45.
{
46.
47.
name:
'john'
48.
49.
},
50.
51.
{
52.
53.
name:
'jake'
54.
55.
}]);
56.
57.
58.
59.
60.
61.
//you can test *single values* against your custom sifter
62.
63.
siftPeople.test({ name:
'sarah'
});
//true
64.
65.
siftPeople.test({ name:
'tim'
});
//false\
1.
"holder.js/300x200"
/>
WinJS
这个项目由为微软开放技术工作的WinJS开发团队积极参与,并与开源代码开发者社区有所合作。我们共同致力于创建尽可能最好的HTML/JS/CSS应用开发的解决方案。WinJS是一套允许开发者使用HTML/JS/CSS创建应用程序的JavaScript工具包。