You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/company/about.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
npm is lots of things.
4
4
5
-
* npm is the package manager for [Node.js](https://nodejs.org/). It was created in 2009 as an [open source project](https://github.com/npm/npm) to help JavaScript developers easily share packaged modules of code.
5
+
* npm is the package manager for [Node.js](https://nodejs.org/). It was created in 2009 as an [open source project](https://github.com/npm/npm) to help JavaScript developers easily share packaged modules of code.
6
6
* The npm Registry is a public collection of packages of open-source code for Node.js, [front-end web apps](http://www.ember-cli.com/), [mobile apps](https://cordova.apache.org/), [robots](https://tessel.io/), [routers](https://linerate.f5.com/), and countless other needs of the JavaScript community.
7
7
* npm is the command line client that allows developers to install and publish those packages.
8
8
* npm, Inc. is the company that hosts and maintains all of the above.
Copy file name to clipboardExpand all lines: content/company/private-npm.md
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,38 +2,36 @@
2
2
## Publish, share and install proprietary code easily
3
3
4
4
[Private modules](https://www.npmjs.com/npm/private-packages) are ordinary npm packages that only you, and people you select,
5
-
can view, install, and publish. You publish them in your namespace or your team's namespace, just by giving them a name in package.json:
5
+
can view, install, and publish. You publish them in your namespace or your team's namespace by giving them a name in package.json:
6
6
7
7
```json
8
8
{
9
9
"name": "@myuser/mypackage"
10
10
}
11
11
```
12
12
13
-
You publish them with `npm publish`, just like any other package, and you install
13
+
You publish them with `npm publish` just like any other package, and you install
14
14
them by name:
15
15
16
16
```sh
17
17
npm install @myuser/mypackage
18
18
```
19
19
20
-
Once installed, use them by requiring them by name, just like any package:
20
+
Once installed, use them by requiring them by name, just like any other package:
21
21
22
22
```js
23
23
var mypackage =require('@myuser/mypackage');
24
24
```
25
25
26
26
## Re-use your code
27
27
28
-
You re-use code between projects. npm and the registry make it really easy to
29
-
share small modules of useful code with the world. But sometimes the code in that
30
-
package is private, or sensitive, or just too specific to your needs for you to
31
-
want to publish it to the public registry. Private packages are great for this.
28
+
npm and the registry make it easy to share small modules of useful code with the world. However, sometimes the code in your package is private, sensitive, or just too specific to your needs for you to
29
+
want to publish it to the public registry. Private packages allow you to share your code with a specific set of users, rather than the registry as a whole.
32
30
33
31
## Share proprietary code
34
32
35
-
You work in a team, or you work for clients. You want to be able to easily share
36
-
your work, with the dependency management and version management that npm provides.
37
-
By making it easy and granular to select who can see, install and publish packages,
33
+
Whether you work in a team or you work for clients, you want to be able to privately share
34
+
your work using the dependency management and version management that npm provides.
35
+
By allowing you to control who can see, install and publish packages,
38
36
[private packages](https://www.npmjs.com/npm/private-packages) make this easy.
Copy file name to clipboardExpand all lines: content/getting-started/creating-node-modules.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ featured: true
9
9
10
10
Node.js modules are one kind of package which can be published to npm. When you create a new module, you want to start with the `package.json` file.
11
11
12
-
You can use `npm init` to create the `package.json`. It will prompt you for values for the `package.json` fields. The two required fields are name and version. You'll also want to have a value for main. You can use the default, `index.js`.
12
+
You can use `npm init` to create the `package.json`. It will prompt you for values for the `package.json` fields. The two required fields are 'name' and 'version'. You'll also want to have a value for 'main'. You can use the default, `index.js`.
13
13
14
14
If you want to add information for the author field, you can use the following format (email and web site are both optional):
15
15
@@ -29,8 +29,8 @@ exports.printMsg = function() {
29
29
30
30
Test:
31
31
32
-
1. Publish your package to npm
33
-
1. Make a new directory outside of your project and cd into it
34
-
1. Run `npm install <package>`
35
-
1. Create a test.js file which requires the package and calls the method
32
+
1. Publish your package to npm.
33
+
1. Make a new directory outside of your project and cd into it.
34
+
1. Run `npm install <package>`.
35
+
1. Create a test.js file which requires the package and calls the method.
36
36
1. Run `node test.js`. The message should be output.
<p>If you've been working with JavaScript for a while, you might have heard of npm: npm makes it easy for JavaScript developers to share the code that they've created to solve particular problems, and for other developers to reuse that code in their own applications.</p>
12
+
<p>If you've been working with JavaScript for a while, you might have heard of npm. npm makes it easy for JavaScript developers to share the code that they've created to solve particular problems, and for other developers to reuse that code in their own applications.</p>
13
13
14
-
<p>Once you're depending on this code from other developers, npm makes it really easy to check to see if they've made any updates to it, and to download those updates when they're made.</p>
14
+
<p>Once you're depending on this code from other developers, npm makes it easy to check to see if they've made any updates to it and to download those updates when they're made.</p>
15
15
16
-
<p>These bits of reusable code are called packages, or sometimes modules. A package is just a directory with one or more files in it, that also has a file called "package.json" with some metadata about this package. A typical application, such as a website, will depend on dozens or hundreds of packages. These packages are often small. The general idea is that you create a small building block which solves one problem and solves it well. This makes it possible for you to compose larger, custom solutions out of these small, shared building blocks.</p>
16
+
<p>These bits of reusable code are called packages or modules. A package is just a directory with one or more files in it, along with a file called "package.json" that contains metadata about the package. A typical application, such as a website, will depend on dozens or hundreds of packages. These packages are often small. The general idea is that you create a small building block which solves one problem well. This makes it possible for you to compose larger custom solutions out of these small building blocks.</p>
17
17
18
-
<p>There's lots of benefits to this. It makes it possible for your team to draw on expertise outside of your organization by bringing in packages from people who have focused on particular problem areas. But even if you don't reuse code from people outside of your organization, using this kind of modulebased approach can actually help your team work together better, and can also make it possible to reuse code across projects.</p>
18
+
<p>There's lots of benefits to this; It makes it possible for your team to draw on expertise outside of your organization by bringing in packages from people who have focused on particular problem areas. Even if you don't reuse code from people outside of your organization, using this kind of module-based approach can help your team work together better and make it possible to reuse code across projects.</p>
19
19
20
-
<p>You can find packages to help you build your application by browsing the npm website. When you're browsing the website, you'll find different kinds of packages. You'll find lots of node modules. npm started as the node package manager, so you'll find lots of modules which can be used on the server side. There are also lots of packages which add commands for you to use in the command line. And at this point you can find a number of packages which can be used in the browser, on the front end.</p>
20
+
<p>You can find packages to help you build your application by browsing the npm website. When you're browsing the website, you'll find lots of Node modules. npm started as the Node package manager, so you'll find lots of modules which can be used on the server side. There are also lots of packages which add commands for you to use in the command line. You'll also find packages which can be used on the front end.</p>
21
21
22
-
<p>So now that you have an idea of what npm can do, let's talk about how it works. When people talk about npm, they can be talking about one of three things. They could be talking about the website, which we've just been looking at. Or they could be talking about the registry, which is a big database of information about packages that people are sharing. Or the third thing they could be talking about is the client: when a developer decides to share their code, they use the npm client which is installed on their computer to publish that code up to the registry. And once there's an entry for this package in the registry, then other developers can use their npm clients to install the package from the registry. The entry in the registry for this package is also reflected on the website, where there's a page dedicated to this new package.</p>
22
+
<p>Now that you have an idea of what npm can do, let's talk about how it works. When people talk about npm, they can be talking about one of three things. They could be talking about the website, which we've just been looking at. Or they could be talking about the registry, which is a big database of information about packages that people are sharing. Or the third thing they could be talking about is the client: when a developer decides to share their code, they use the npm client which is installed on their computer to publish that code up to the registry. And once there's an entry for this package in the registry, then other developers can use their npm clients to install the package from the registry. The entry in the registry for this package is also reflected on the website, where there's a page dedicated to this new package.</p>
23
23
24
24
<p>So that's what npm is. It's a way to reuse code from other developers, and also a way to share your code with them, and it makes it easy to manage the different versions of code.</p>
0 commit comments