pjson

WebJar for pjson

Лицензия

Лицензия

MIT
Категории

Категории

JSON Данные
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

pjson
Последняя версия

Последняя версия

1.0.9
Дата

Дата

Тип

Тип

jar
Описание

Описание

pjson
WebJar for pjson
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/serkanyersen/pjson

Скачать pjson

Имя Файла Размер
pjson-1.0.9.pom
pjson-1.0.9.jar 6 KB
pjson-1.0.9-sources.jar 22 bytes
pjson-1.0.9-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/pjson/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>pjson</artifactId>
    <version>1.0.9</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/pjson/
implementation 'org.webjars.npm:pjson:1.0.9'
// https://jarcasting.com/artifacts/org.webjars.npm/pjson/
implementation ("org.webjars.npm:pjson:1.0.9")
'org.webjars.npm:pjson:jar:1.0.9'
<dependency org="org.webjars.npm" name="pjson" rev="1.0.9">
  <artifact name="pjson" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='pjson', version='1.0.9')
)
libraryDependencies += "org.webjars.npm" % "pjson" % "1.0.9"
[org.webjars.npm/pjson "1.0.9"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

PJSON

FOSSA Status

PJSON is a simple npm package that lets you read the package.json file.

Usage

Install it

npm install pjson --save

and use it in your code like this

var pjson = require('pjson');

// simply access values package.json
console.log(pjson.version);

Why?

In Node.js you can already import json files by simple giving their names in the require statements but this approach doesn't always work well.

First of all it's path dependent. So if your project has a nested structure you might end up with code that looks like this

var pjson = require('../../../package.json');

TypeScript

In typescript you cannot create module definitions for relatively imported things. PJSON resolves this issue for you because you can import it just by name

Old versions of Node

Importing JSON files using require is only enabled in later versions of node. For old versions, PJSON might be useful

Because I need it

It's simple, I needed it for my own project and I though it might be useful for others as well :)

License

FOSSA Status

Версии библиотеки

Версия
1.0.9