Skip to content

Commit

Permalink
readme tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
seanemmer committed Jun 2, 2015
1 parent 218d029 commit d972020
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mongoose-seed

mongoose-seed lets you populate and clear MongoDB documents with all the benefits of Mongoose validation.
mongoose-seed lets you populate and clear MongoDB documents with all the benefits of Mongoose validation

## Basic example

Expand All @@ -19,8 +19,10 @@ seeder.connect('mongodb://localhost/sample-dev', function() {

// Clear specified collections
seeder.clearModels(['Model1', 'Model2'], function() {

// Callback to populate DB once collections have been cleared
seeder.populateModels(data);

});
});

Expand Down
106 changes: 106 additions & 0 deletions npm-debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'publish' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink /usr/local/bin/node
5 verbose publish [ '.' ]
6 silly cache add args [ '.', null ]
7 verbose cache add spec .
8 silly cache add parsed spec { raw: '.',
8 silly cache add scope: null,
8 silly cache add name: null,
8 silly cache add rawSpec: '.',
8 silly cache add spec: '/Users/SEmmer/Developer/node_projects/mongoose-seed',
8 silly cache add type: 'directory' }
9 verbose addLocalDirectory /Users/SEmmer/.npm/mongoose-seed/0.1.2/package.tgz not in flight; packing
10 verbose tar pack [ '/Users/SEmmer/.npm/mongoose-seed/0.1.2/package.tgz',
10 verbose tar pack '/Users/SEmmer/Developer/node_projects/mongoose-seed' ]
11 verbose tarball /Users/SEmmer/.npm/mongoose-seed/0.1.2/package.tgz
12 verbose folder /Users/SEmmer/Developer/node_projects/mongoose-seed
13 info prepublish [email protected]
14 verbose addLocalTarball adding from inside cache /Users/SEmmer/.npm/mongoose-seed/0.1.2/package.tgz
15 silly cache afterAdd [email protected]
16 verbose afterAdd /Users/SEmmer/.npm/mongoose-seed/0.1.2/package/package.json not in flight; writing
17 verbose afterAdd /Users/SEmmer/.npm/mongoose-seed/0.1.2/package/package.json written
18 silly publish { name: 'mongoose-seed',
18 silly publish version: '0.1.2',
18 silly publish description: 'Seed data population for Mongoose',
18 silly publish main: 'index.js',
18 silly publish scripts: { test: 'echo "Error: no test specified" && exit 1' },
18 silly publish repository:
18 silly publish { type: 'git',
18 silly publish url: 'git+https://github.com/seanemmer/mongoose-seed.git' },
18 silly publish keywords:
18 silly publish [ 'mongoose',
18 silly publish 'seed',
18 silly publish 'mongodb',
18 silly publish 'node',
18 silly publish 'node.js',
18 silly publish 'MEAN',
18 silly publish 'MEAN.js',
18 silly publish 'MEAN.io' ],
18 silly publish author: { name: 'Sean Emmer' },
18 silly publish license: 'MIT',
18 silly publish bugs: { url: 'https://github.com/seanemmer/mongoose-seed/issues' },
18 silly publish homepage: 'https://github.com/seanemmer/mongoose-seed#readme',
18 silly publish dependencies:
18 silly publish { async: '~1.2.0',
18 silly publish chalk: '~1.0.0',
18 silly publish lodash: '~3.9.3',
18 silly publish path: '~0.11.14' },
18 silly publish readme: '# mongoose-seed\n\nmongoose-seed lets you populate and clear MongoDB documents with all the benefits of Mongoose validation. \n\n## Basic example\n\n```javascript\n\nvar seeder = require(\'mongoose-seed\');\n\n// Connect to MongoDB via Mongoose\nseeder.connect(\'mongodb://localhost/sample-dev\', function() {\n\t\n\t// Load Mongoose models\n\tseeder.loadModels([\n\t\t\'app/model1File.js\',\n\t\t\'app/model2File.js\'\n\t]);\n\n\t// Clear specified collections\n\tseeder.clearModels([\'Model1\', \'Model2\'], function() {\n\n\t\t// Callback to populate DB once collections have been cleared\n\t\tseeder.populateModels(data);\n\t\t\n\t});\n});\n\n// Data array containing seed data - documents organized by Model\nvar data = [\n\t{ \n\t\t\'model\': \'Model1\',\n\t\t\'documents\': [\n\t\t\t{\n\t\t\t\t\'name\': \'Doc1\'\n\t\t\t\t\'value\': 200\n\t\t\t},\n\t\t\t{\n\t\t\t\t\'name\': \'Doc2\'\n\t\t\t\t\'value\': 400\n\t\t\t}\n\t\t]\n\t}\n];\t\n\n\n```\n\n## Methods\n\n### seeder.connect(db, [callback])\n\nInitializes connection to MongoDB via Mongoose singleton\n\n---------------------------------------\n\n### seeder.loadModels(filePaths)\n\nLoads mongoose models into Mongoose singleton. *Only Models that have been loaded can be cleared or populated.*\n\n---------------------------------------\n\n### seeder.clearModels(modelArray, [callback])\n\nClears DB collection specified by each model in modelArray. Callback is executed after DB is cleared (useful for populateModels method)\n\n---------------------------------------\n\n### seeder.populateModels(dataArray)\n\nPopulates MongoDB with documents in dataArray. dataArray consists of objects with \'model\' and \'documents\' keys, where \'documents\' is an array of valid collection documents. Note that Mongoose Schema validation *is* enforced.\n',
18 silly publish readmeFilename: 'README.md',
18 silly publish gitHead: 'e713f06d9c45634198b08763c1b41c5bcfad3a8f',
18 silly publish _id: '[email protected]',
18 silly publish _shasum: 'b517197f8de4ed6b5d5661a76c5305c5b4799459',
18 silly publish _from: '.' }
19 verbose getPublishConfig undefined
20 silly mapToRegistry name mongoose-seed
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry https://registry.npmjs.org/
23 silly mapToRegistry uri https://registry.npmjs.org/mongoose-seed
24 verbose publish registryBase https://registry.npmjs.org/
25 silly publish uploading /Users/SEmmer/.npm/mongoose-seed/0.1.2/package.tgz
26 verbose request uri https://registry.npmjs.org/mongoose-seed
27 verbose request sending authorization for write operation
28 info attempt registry request try #1 at 15:54:16
29 verbose request using bearer token for auth
30 verbose request id dcf3ac3576915add
31 http request PUT https://registry.npmjs.org/mongoose-seed
32 http 403 https://registry.npmjs.org/mongoose-seed
33 verbose headers { 'content-type': 'application/json',
33 verbose headers 'cache-control': 'max-age=60',
33 verbose headers 'content-length': '95',
33 verbose headers 'accept-ranges': 'bytes',
33 verbose headers date: 'Tue, 02 Jun 2015 22:51:16 GMT',
33 verbose headers via: '1.1 varnish',
33 verbose headers connection: 'keep-alive',
33 verbose headers 'x-served-by': 'cache-sjc3127-SJC',
33 verbose headers 'x-cache': 'MISS',
33 verbose headers 'x-cache-hits': '0',
33 verbose headers 'x-timer': 'S1433285475.264273,VS0,VE912' }
34 verbose request invalidating /Users/SEmmer/.npm/registry.npmjs.org/mongoose-seed on PUT
35 error publish Failed PUT 403
36 verbose stack Error: "You cannot publish over the previously published version 0.1.2." : mongoose-seed
36 verbose stack at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:247:14)
36 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14)
36 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:368:22)
36 verbose stack at Request.emit (events.js:110:17)
36 verbose stack at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1219:14)
36 verbose stack at Request.emit (events.js:129:20)
36 verbose stack at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1167:12)
36 verbose stack at IncomingMessage.emit (events.js:129:20)
36 verbose stack at _stream_readable.js:908:16
36 verbose stack at process._tickCallback (node.js:355:11)
37 verbose statusCode 403
38 verbose pkgid mongoose-seed
39 verbose cwd /Users/SEmmer/Developer/node_projects/mongoose-seed
40 error Darwin 14.0.0
41 error argv "node" "/usr/local/bin/npm" "publish"
42 error node v0.12.0
43 error npm v2.9.0
44 error code E403
45 error "You cannot publish over the previously published version 0.1.2." : mongoose-seed
46 error If you need help, you may report this error at:
46 error <https://github.com/npm/npm/issues>
47 verbose exit [ 1, true ]

0 comments on commit d972020

Please sign in to comment.