UNPKG

mongoose-data-seed

Version:

Seed mongodb with data using mongoose models

1,453 lines (1,452 loc) 81.7 kB
{ "type": "File", "start": 0, "end": 678, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 27, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 678, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 27, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 52, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 52 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 25, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 25 } }, "local": { "type": "Identifier", "start": 7, "end": 25, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 25 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" } } ], "source": { "type": "StringLiteral", "start": 31, "end": 51, "loc": { "start": { "line": 1, "column": 31 }, "end": { "line": 1, "column": 51 } }, "extra": { "rawValue": "command-line-usage", "raw": "'command-line-usage'" }, "value": "command-line-usage" } }, { "type": "ImportDeclaration", "start": 53, "end": 106, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 53 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 60, "end": 77, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 24 } }, "local": { "type": "Identifier", "start": 60, "end": 77, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 24 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions" } } ], "source": { "type": "StringLiteral", "start": 83, "end": 105, "loc": { "start": { "line": 2, "column": 30 }, "end": { "line": 2, "column": 52 } }, "extra": { "rawValue": "./option-definitions", "raw": "'./option-definitions'" }, "value": "./option-definitions" }, "trailingComments": [ { "type": "CommentBlock", "value": "*\n * @private\n ", "start": 108, "end": 127, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ] }, { "type": "Identifier", "start": 128, "end": 649, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 24, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 134, "end": 648, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 24, "column": 2 } }, "id": { "type": "Identifier", "start": 134, "end": 144, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 16 }, "identifierName": "usageGuide" }, "name": "usageGuide", "leadingComments": null }, "init": { "type": "CallExpression", "start": 147, "end": 648, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 24, "column": 2 } }, "callee": { "type": "Identifier", "start": 147, "end": 165, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 7, "column": 37 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" }, "arguments": [ { "type": "ArrayExpression", "start": 166, "end": 647, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 24, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 170, "end": 363, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 12, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 176, "end": 215, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 43 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 176, "end": 182, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 184, "end": 215, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 43 } }, "extra": { "rawValue": "Initialize mongoose-data-seed", "raw": "'Initialize mongoose-data-seed'" }, "value": "Initialize mongoose-data-seed" } }, { "type": "ObjectProperty", "start": 221, "end": 358, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 11, "column": 81 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 221, "end": 228, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "TemplateLiteral", "start": 230, "end": 358, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 11, "column": 81 } }, "expressions": [], "quasis": [ { "type": "TemplateElement", "start": 231, "end": 357, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 11, "column": 80 } }, "value": { "raw": "Install mongoose-data-seed into your project.\n Generate md-seed-config.js, md-seed-generator.js and create seeders folder", "cooked": "Install mongoose-data-seed into your project.\n Generate md-seed-config.js, md-seed-generator.js and create seeders folder" }, "tail": true } ] } } ] }, { "type": "ObjectExpression", "start": 367, "end": 577, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 19, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 373, "end": 391, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 373, "end": 379, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 381, "end": 391, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 22 } }, "extra": { "rawValue": "Synopsis", "raw": "'Synopsis'" }, "value": "Synopsis" } }, { "type": "ObjectProperty", "start": 397, "end": 572, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 18, "column": 5 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 397, "end": 404, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "ArrayExpression", "start": 406, "end": 572, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 18, "column": 5 } }, "elements": [ { "type": "StringLiteral", "start": 414, "end": 527, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 119 } }, "extra": { "rawValue": "$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]", "raw": "'$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]'" }, "value": "$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]" }, { "type": "StringLiteral", "start": 535, "end": 565, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 36 } }, "extra": { "rawValue": "$ md-seed init {bold --help}", "raw": "'$ md-seed init {bold --help}'" }, "value": "$ md-seed init {bold --help}" } ] } } ] }, { "type": "ObjectExpression", "start": 581, "end": 644, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 23, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 587, "end": 604, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 21 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 587, "end": 593, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 595, "end": 604, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 21 } }, "extra": { "rawValue": "Options", "raw": "'Options'" }, "value": "Options" } }, { "type": "ObjectProperty", "start": 610, "end": 639, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 33 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 610, "end": 620, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 14 }, "identifierName": "optionList" }, "name": "optionList" }, "value": { "type": "Identifier", "start": 622, "end": 639, "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 22, "column": 33 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions" } } ] } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 651, "end": 677, "loc": { "start": { "line": 26, "column": 0 }, "end": { "line": 26, "column": 26 } }, "declaration": { "type": "Identifier", "start": 666, "end": 676, "loc": { "start": { "line": 26, "column": 15 }, "end": { "line": 26, "column": 25 }, "identifierName": "usageGuide" }, "name": "usageGuide" }, "name": "_", "leadingComments": [], "trailingComments": [] }, { "type": "ExportDefaultDeclaration", "start": 651, "end": 677, "loc": { "start": { "line": 26, "column": 0 }, "end": { "line": 26, "column": 26 } }, "declaration": { "type": "VariableDeclaration", "start": 128, "end": 649, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 24, "column": 3 } }, "declarations": [ { "type": "VariableDeclarator", "start": 134, "end": 648, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 24, "column": 2 } }, "id": { "type": "Identifier", "start": 134, "end": 144, "loc": { "start": { "line": 7, "column": 6 }, "end": { "line": 7, "column": 16 }, "identifierName": "usageGuide" }, "name": "usageGuide", "leadingComments": null }, "init": { "type": "CallExpression", "start": 147, "end": 648, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 24, "column": 2 } }, "callee": { "type": "Identifier", "start": 147, "end": 165, "loc": { "start": { "line": 7, "column": 19 }, "end": { "line": 7, "column": 37 }, "identifierName": "generateUsageGuide" }, "name": "generateUsageGuide" }, "arguments": [ { "type": "ArrayExpression", "start": 166, "end": 647, "loc": { "start": { "line": 7, "column": 38 }, "end": { "line": 24, "column": 1 } }, "elements": [ { "type": "ObjectExpression", "start": 170, "end": 363, "loc": { "start": { "line": 8, "column": 2 }, "end": { "line": 12, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 176, "end": 215, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 43 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 176, "end": 182, "loc": { "start": { "line": 9, "column": 4 }, "end": { "line": 9, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 184, "end": 215, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 43 } }, "extra": { "rawValue": "Initialize mongoose-data-seed", "raw": "'Initialize mongoose-data-seed'" }, "value": "Initialize mongoose-data-seed" } }, { "type": "ObjectProperty", "start": 221, "end": 358, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 11, "column": 81 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 221, "end": 228, "loc": { "start": { "line": 10, "column": 4 }, "end": { "line": 10, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "TemplateLiteral", "start": 230, "end": 358, "loc": { "start": { "line": 10, "column": 13 }, "end": { "line": 11, "column": 81 } }, "expressions": [], "quasis": [ { "type": "TemplateElement", "start": 231, "end": 357, "loc": { "start": { "line": 10, "column": 14 }, "end": { "line": 11, "column": 80 } }, "value": { "raw": "Install mongoose-data-seed into your project.\n Generate md-seed-config.js, md-seed-generator.js and create seeders folder", "cooked": "Install mongoose-data-seed into your project.\n Generate md-seed-config.js, md-seed-generator.js and create seeders folder" }, "tail": true } ] } } ] }, { "type": "ObjectExpression", "start": 367, "end": 577, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 19, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 373, "end": 391, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 22 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 373, "end": 379, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 14, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 381, "end": 391, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 22 } }, "extra": { "rawValue": "Synopsis", "raw": "'Synopsis'" }, "value": "Synopsis" } }, { "type": "ObjectProperty", "start": 397, "end": 572, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 18, "column": 5 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 397, "end": 404, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 11 }, "identifierName": "content" }, "name": "content" }, "value": { "type": "ArrayExpression", "start": 406, "end": 572, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 18, "column": 5 } }, "elements": [ { "type": "StringLiteral", "start": 414, "end": 527, "loc": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 119 } }, "extra": { "rawValue": "$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]", "raw": "'$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]'" }, "value": "$ md-seed init [{bold --seedersFolder}={underline folder-name}] [{bold --seederTemplate}={underline file-path}]" }, { "type": "StringLiteral", "start": 535, "end": 565, "loc": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 36 } }, "extra": { "rawValue": "$ md-seed init {bold --help}", "raw": "'$ md-seed init {bold --help}'" }, "value": "$ md-seed init {bold --help}" } ] } } ] }, { "type": "ObjectExpression", "start": 581, "end": 644, "loc": { "start": { "line": 20, "column": 2 }, "end": { "line": 23, "column": 3 } }, "properties": [ { "type": "ObjectProperty", "start": 587, "end": 604, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 21 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 587, "end": 593, "loc": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 10 }, "identifierName": "header" }, "name": "header" }, "value": { "type": "StringLiteral", "start": 595, "end": 604, "loc": { "start": { "line": 21, "column": 12 }, "end": { "line": 21, "column": 21 } }, "extra": { "rawValue": "Options", "raw": "'Options'" }, "value": "Options" } }, { "type": "ObjectProperty", "start": 610, "end": 639, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 33 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 610, "end": 620, "loc": { "start": { "line": 22, "column": 4 }, "end": { "line": 22, "column": 14 }, "identifierName": "optionList" }, "name": "optionList" }, "value": { "type": "Identifier", "start": 622, "end": 639, "loc": { "start": { "line": 22, "column": 16 }, "end": { "line": 22, "column": 33 }, "identifierName": "optionDefinitions" }, "name": "optionDefinitions" } } ] } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * @private\n ", "start": 108, "end": 127, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ], "trailingComments": [] } } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * @private\n ", "start": 108, "end": 127, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 6, "column": 3 } } } ], "tokens": [ { "type": { "label": "import", "keyword": "import", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "import", "start": 0, "end": 6, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 6 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "generateUsageGuide", "start": 7, "end": 25, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 25 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "from", "start": 26, "end": 30, "loc": { "start": { "line": 1, "column": 26 }, "end": { "line": 1, "column": 30 } } }, { "type": { "label": "string", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "command-line-usage", "start": 31, "end": 51, "loc": { "start": { "line": 1, "column": 31