You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

mongodb-moment

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-moment - npm Package Compare versions

Comparing version

to
1.0.2

16

package.json
{
"name": "mongodb-moment",
"version": "1.0.1",
"version": "1.0.2",
"description": "Make the mongodb node driver able to serialize moment.js objects",

@@ -15,14 +15,14 @@ "keywords": [

"devDependencies": {
"acquit": "0.4.0",
"acquit-ignore": "0.0.3",
"acquit-markdown": "0.0.5",
"acquit": "1.0.0",
"acquit-ignore": "0.1.0",
"acquit-markdown": "0.1.0",
"co": "4.6.0",
"mocha": "2.2.4",
"moment": "2.1.x",
"mongodb": "2.1.x"
"mocha": "5.x",
"moment": "~2.2",
"mongodb": "3.x"
},
"repository": {
"type": "git",
"url": "git://github.com/vkarpov15/mongodb-moment.git"
"url": "git://github.com/boosterfuels/mongodb-moment.git"
}
}

@@ -0,1 +1,3 @@

# mongodb-moment

@@ -9,18 +11,22 @@

## example
## It example
```javascript
const moment = require('moment');
require('mongodb-moment')(moment);
const moment = require('moment');
require('mongodb-moment')(moment);
co(function*() {
const id = new mongodb.ObjectId();
yield db.collection('test').
insertOne({ _id: id, createdAt: moment.utc('2011-06-01') });
co(function*() {
const id = new mongodb.ObjectId();
yield db.collection('test').
insertOne({ _id: id, createdAt: moment.utc('2011-06-01') });
const res = yield db.collection('test').findOne();
assert.deepEqual(res, { _id: id, createdAt: new Date('2011-06-01') });
})
```
const res = yield db.collection('test').findOne();
assert.deepEqual(res, { _id: id, createdAt: new Date('2011-06-01') });
// acquit:ignore:start
done();
// acquit:ignore:end
})
// acquit:ignore:start
.catch(done);
// acquit:ignore:end
```

@@ -13,2 +13,3 @@ 'use strict';

describe('mongodb-moment', function() {
let client;
let db;

@@ -18,4 +19,5 @@

co(function*() {
db = yield mongodb.MongoClient.
connect('mongodb://localhost:27017/moment');
client = yield mongodb.MongoClient.
connect('mongodb://localhost:27017/moment', { useNewUrlParser: true });
db = client.db();
yield db.dropDatabase();

@@ -26,2 +28,6 @@ done();

after(function() {
return client.close();
});
it('example', function(done) {

@@ -28,0 +34,0 @@ const moment = require('moment');

Sorry, the diff of this file is not supported yet