buyersbion.blogg.se

Package.json unpkg
Package.json unpkg





package.json unpkg
  1. Package.json unpkg install#
  2. Package.json unpkg manual#
  3. Package.json unpkg Patch#
  4. Package.json unpkg license#

  • >=2.4: A version greater or equal to 2.4.
  • 2.x: Works for any minor version of the package’s 2 version.
  • Package.json unpkg Patch#

    2.4.x: Works with any patch version of the package’s 2.4 version.^2.4.2: The latest version compatible with version 2.4.2.This way, npm will issue a warning when some peer dependencies are missing.Īs you’ve probably seen before, dependencies can accept different formats to specify which versions or range of versions can be used for a dependency. peerDependencies: Peer dependencies are useful for specifying modules that your project depends on.

    Package.json unpkg install#

    Use the -save-bundle flag with the install command for a dependency to also be added to the list of bundled dependencies.

  • bundledDependencies: Expects an array of package names, which will be bundled with the project.
  • Install optional dependencies using the -save-optional with the install command. That means that npm won’t complain or fail to install when optional dependencies can’t be met.
  • optionalDependencies: Dependencies that should be treated as optional by npm.
  • Add a devDependency using npm’s -save-dev flag with the install command. For example, testing libraries and transpilers should most often be added as devDependencies.
  • devDependencies: Dependencies that are useful only when working on the project.
  • Add such dependencies to your project using $ npm install my-dependency. This is where the bulk of your dependencies will most likely be.
  • dependencies: Normal project dependencies.
  • There’s the regular dependencies, but there can also be devDependencies, peerDependencies, optionalDependencies and bundledDependencies. It’s therefore only natural that the package.json file for a project centers mostly around specifying the dependencies for a project. Npm’s main strength is its ability to easily manage a project’s dependencies. You can also use UNLICENSED for projects that are private and closed-source.

    Package.json unpkg license#

    It defaults to the ISC license, and MIT would be another popular license choice. license: Expects a license name using its SPDX identifier.It makes it easy for people to then get in touch with the project’s owner. author: The author field expects an object with keys for name, email and url.keywords: An array of keywords to helps with finding the module on the npm repository.

    Package.json unpkg manual#

    Chances are that scripts is where you’ll make the most manual changes in a typical package.json file. This is useful to specify scripts that can be run directly from the command line and that can do all sorts of things like starting your project on a local server, building for production or running your tests. scripts: The scripts key expects an object with script names as keys and commands as values.This is optional and is useful if you can the project to be found easily on the repository. description: A description for the project.This is also optional for private and required and very important for public modules. version: A version number that should be understandable by node-semver.

    package.json unpkg

    The name can be prefixed with a scope (i.e.: and is optional if the project is private, but if the project is to be published publicly the name is required and must be unique on the npm repository.

  • name: The name for the project, which should be all lower case and URL-safe.
  • Let’s go over each of the keys in an initial package.json file: The init command will write a package.json file to the current directory with JSON content that looks like this: The name of the project will be the same as the name of the current folder you’re in.







    Package.json unpkg