-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
61 lines (61 loc) · 3.85 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
"name": "bson",
"description": "A bson parser for node.js and the browser",
"keywords": [
"mongodb",
"bson",
"parser"
],
"version": "0.3.2",
"author": {
"name": "Christian Amor Kvalheim",
"email": "christkv@gmail.com"
},
"contributors": [],
"repository": {
"type": "git",
"url": "git://github.com/mongodb/js-bson.git"
},
"bugs": {
"url": "https://github.com/mongodb/js-bson/issues"
},
"devDependencies": {
"nodeunit": "0.9.0",
"gleak": "0.2.3",
"one": "2.X.X"
},
"optionalDependencies": {
"bson-ext": "~0.1"
},
"config": {
"native": false
},
"main": "./lib/bson/index",
"directories": {
"lib": "./lib/bson"
},
"engines": {
"node": ">=0.6.19"
},
"scripts": {
"test": "nodeunit ./test/node && TEST_NATIVE=TRUE nodeunit ./test/node"
},
"browser": "lib/bson/bson.js",
"licenses": [
{
"type": "Apache License, Version 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"readme": "Javascript + C++ BSON parser\n============================\n\nThis BSON parser is primarily meant to be used with the `mongodb` node.js driver.\nHowever, wonderful tools such as `onejs` can package up a BSON parser that will work in the browser.\nThe current build is located in the `browser_build/bson.js` file.\n\nA simple example of how to use BSON in the browser:\n\n```html\n<html>\n<head>\n <script src=\"https://raw.github.com/mongodb/js-bson/master/browser_build/bson.js\">\n </script>\n</head>\n<body onload=\"start();\">\n<script>\n function start() {\n var BSON = bson().BSON;\n var Long = bson().Long;\n\n var doc = {long: Long.fromNumber(100)}\n\n // Serialize a document\n var data = BSON.serialize(doc, false, true, false);\n // De serialize it again\n var doc_2 = BSON.deserialize(data);\n }\n</script>\n</body>\n</html>\n```\n\nA simple example of how to use BSON in `node.js`:\n\n```javascript\nvar bson = require(\"bson\");\nvar BSON = bson.BSONPure.BSON;\nvar Long = bson.BSONPure.Long;\n\nvar doc = {long: Long.fromNumber(100)}\n\n// Serialize a document\nvar data = BSON.serialize(doc, false, true, false);\nconsole.log(\"data:\", data);\n\n// Deserialize the resulting Buffer\nvar doc_2 = BSON.deserialize(data);\nconsole.log(\"doc_2:\", doc_2);\n```\n\nThe API consists of two simple methods to serialize/deserialize objects to/from BSON format:\n\n * BSON.serialize(object, checkKeys, asBuffer, serializeFunctions)\n * @param {Object} object the Javascript object to serialize.\n * @param {Boolean} checkKeys the serializer will check if keys are valid.\n * @param {Boolean} asBuffer return the serialized object as a Buffer object **(ignore)**.\n * @param {Boolean} serializeFunctions serialize the javascript functions **(default:false)**\n * @return {TypedArray/Array} returns a TypedArray or Array depending on what your browser supports\n \n * BSON.deserialize(buffer, options, isArray)\n * Options\n * **evalFunctions** {Boolean, default:false}, evaluate functions in the BSON document scoped to the object deserialized.\n * **cacheFunctions** {Boolean, default:false}, cache evaluated functions for reuse.\n * **cacheFunctionsCrc32** {Boolean, default:false}, use a crc32 code for caching, otherwise use the string of the function.\n * @param {TypedArray/Array} a TypedArray/Array containing the BSON data\n * @param {Object} [options] additional options used for the deserialization.\n * @param {Boolean} [isArray] ignore used for recursive parsing.\n * @return {Object} returns the deserialized Javascript Object.\n",
"readmeFilename": "README.md",
"dependencies": {
"bson-ext": "~0.1"
},
"_id": "bson@0.3.2",
"dist": {
"shasum": "86217ea64c099a12992dd8fb12c661ab73734859"
},
"_from": "bson@~0.3",
"_resolved": "https://registry.npmjs.org/bson/-/bson-0.3.2.tgz"
}