task-scripted
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -6,7 +6,7 @@ /*jslint node: true */ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var scripted = require('../bin/scripted'); | ||
var _pathModule = __dirname.replace('lib', ''); | ||
var _template = 'scripted-template.js' | ||
var _pathTemplate = _pathModule + 'config/' + _template; | ||
var _pathTemplate = path.resolve(__dirname, '../config/' + _template); | ||
@@ -37,4 +37,4 @@ var _writeFile = function (name) { | ||
var mongooseFile = 'mongoose.json'; | ||
var path = _pathModule + 'config/' + mongooseFile; | ||
fs.createReadStream(path).pipe(fs.createWriteStream(mongooseFile)); | ||
var file = path.resolve(__dirname, '../config/' + mongooseFile); | ||
fs.createReadStream(file).pipe(fs.createWriteStream(mongooseFile)); | ||
console.log('mongoose.json created'); | ||
@@ -41,0 +41,0 @@ } |
{ | ||
"name": "task-scripted", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Scripted' application to run JS files once.", | ||
@@ -5,0 +5,0 @@ "author": "Daniel Rôhers Moura <rohersmoura@gmail.com> (https://github.com/danielrohers)", |
@@ -1,5 +0,13 @@ | ||
# task-scripted | ||
# Scripted | ||
[Scripted'](https://www.npmjs.com/package/task-scripted) application to run JS files once.. | ||
[Scripted'](https://www.npmjs.com/package/task-scripted) application to run JS files once. | ||
Inspired Rails migrations, Scripted was created to run JS scripts only once, based on scripts already saved in the collection scripts in MongoDB. | ||
Example: [1433298714535-for.js][for] | ||
```sh | ||
$ scripted -c for | ||
$ scripts/1433298714535-for.js created | ||
``` | ||
## Installation | ||
@@ -11,2 +19,20 @@ | ||
## Configuration | ||
You must configure MongoDB, it can be done using mongoose.json or environment variable MONGO_SCRIPTED. | ||
##### mongoose.json | ||
```sh | ||
$ scripted -m | ||
``` | ||
```json | ||
{ | ||
"url" : "mongodb://localhost:27017/scripted" | ||
} | ||
``` | ||
##### Environment variable | ||
In your .bash_profile or similar | ||
```shell | ||
export MONGO_SCRIPTED=mongodb://localhost:27017/scripted | ||
``` | ||
## Command Line Options | ||
@@ -25,4 +51,10 @@ | ||
## Technologies | ||
- [Node.js](https://nodejs.org/) | ||
- [MongoDB](https://www.mongodb.org/) | ||
## License | ||
[MIT](LICENSE) | ||
[for]:https://github.com/danielrohers/task-scripted/blob/master/examples/scripts/1433298714535-for.js |
8072
59