Skip to content

Commit c51b2d0

Browse files
committed
prepping for npm publish
1 parent c560dbf commit c51b2d0

File tree

8 files changed

+98
-12
lines changed

8 files changed

+98
-12
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.travis.yml
2+
TODO.md

Gruntfile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* grunt-node-version-windows
33
*
4+
* Copyright (c) 2016 Connor Uhlman
5+
* Licensed under the MIT license.
6+
*
47
* Fork of grunt-node-version
58
* https://github.com/jking90/grunt-node-version
6-
* Copyright (c) 2013 Jimmy King
7-
* Licensed under the MIT license.
89
*/
910

1011
"use strict";

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 Jimmy King
3+
Copyright (c) 2016 Connor Uhlman
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,80 @@
22

33
> A grunt task to ensure you are using the node version required by your project's package.json
44
5-
#### More info will be available here once the package is released....
5+
## Getting Started
6+
This plugin requires Grunt `~0.4.1` and Node.js `>=0.12.14`.
67

7-
Requires node >=0.12.14
8+
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
89

9-
*Forked from [grunt-node-version](https://github.com/jking90/grunt-node-version) by Jimmy King*
10+
```shell
11+
npm install grunt-node-version-windows --save-dev
12+
```
13+
14+
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
15+
16+
```js
17+
grunt.loadNpmTasks('grunt-node-version-windows');
18+
```
19+
20+
21+
## The "node_version" task
22+
23+
### Overview
24+
In your project's Gruntfile, add a section named `node_version` to the data object passed into `grunt.initConfig()`.
25+
26+
```js
27+
grunt.initConfig({
28+
node_version: {
29+
options: {
30+
alwaysInstall: false,
31+
errorLevel: 'fatal',
32+
globals: [],
33+
nvm: true,
34+
override: "",
35+
debug: false
36+
}
37+
}
38+
})
39+
```
40+
41+
### Options
42+
43+
#### options.alwaysInstall
44+
Type: `Boolean`
45+
Default value: `false`
46+
47+
A boolean that determines whether to install the latest compatible version of node without a prompt (default behavior prompts user to install). This is primarily intended to be used for deployment.
48+
49+
#### options.errorLevel
50+
Type: `String`
51+
Default value: `'fatal'`
52+
53+
The level of error given when the wrong node version is being used. Accepted values are `'warn'` and `'fatal'`. Warn can can be overidden with `--force`, fatal cannot.
54+
55+
#### options.globals
56+
Type: `Array`
57+
Default value: `[]`
58+
59+
An array of node modules required to be installed globally for the project.
60+
61+
#### options.nvm
62+
Type: `Boolean`
63+
Default value: `true`
64+
65+
A boolean that determines whether to attempt to use/install a version of node compatible with the project using [nvm-windows](https://github.com/coreybutler/nvm-windows). If set to `false`, the plugin will just print an error if the wrong node version is being used.
66+
67+
#### options.override
68+
Type: `String`
69+
Default value: `''`
70+
71+
If you want to override the version specified in your project's `package.json`, specify the version you want to use instead here. This is primarily intended for testing projects on other versions of node.
72+
73+
#### options.debug
74+
Type: `Boolean`
75+
Default value: `false`
76+
77+
A boolean that turns detailed logging on / off. If set to `true`, a message will be logged to the console each time a new command is executed. This is primarily used for debugging issues and testing.
78+
79+
##### This plugin only works on Windows and with nvm-windows.
80+
81+
*Forked from [grunt-node-version](https://github.com/jking90/grunt-node-version) by Jimmy King.*

TODO.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# TODO
2+
3+
### Now
4+
- Refactor (eliminate crazy nesting)
5+
- Unit testing (of what's possible)
6+
7+
### Future
8+
- Mocking of commands for testing (is it possible?)
9+
- Are there modules we can use to better interface with npm / nvm-windows?

src/npm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* grunt-node-version-windows
33
*
4+
* Copyright (c) 2016 Connor Uhlman
5+
* Licensed under the MIT license.
6+
*
47
* Fork of grunt-node-version
58
* https://github.com/jking90/grunt-node-version
6-
* Copyright (c) 2013 Jimmy King
7-
* Licensed under the MIT license.
89
*/
910

1011
"use strict";

src/nvm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* grunt-node-version-windows
33
*
4+
* Copyright (c) 2016 Connor Uhlman
5+
* Licensed under the MIT license.
6+
*
47
* Fork of grunt-node-version
58
* https://github.com/jking90/grunt-node-version
6-
* Copyright (c) 2013 Jimmy King
7-
* Licensed under the MIT license.
89
*/
910

1011
"use strict";

tasks/node_version.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
/*
22
* grunt-node-version-windows
33
*
4+
* Copyright (c) 2016 Connor Uhlman
5+
* Licensed under the MIT license.
6+
*
47
* Fork of grunt-node-version
58
* https://github.com/jking90/grunt-node-version
6-
* Copyright (c) 2013 Jimmy King
7-
* Licensed under the MIT license.
89
*/
910

1011
"use strict";

0 commit comments

Comments
 (0)