Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@google-cloud/projectify

googleapis29.9mApache-2.05.0.0TypeScript support: included

A simple utility for replacing the projectid token in objects.

readme

Google Cloud Platform logo

Google Cloud Common Projectify: Node.js Client

release level npm version

A simple utility for replacing the projectid token in objects.

A comprehensive list of changes in each version may be found in the CHANGELOG.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Installing the client library

npm install @google-cloud/projectify

Using the client library

const {replaceProjectIdToken} = require('@google-cloud/projectify');
const options = {
  projectId: '{{projectId}}',
};
replaceProjectIdToken(options, 'fake-project-id');

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

Sample Source Code Try it
Quickstart source code Open in Cloud Shell

The Google Cloud Common Projectify Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-cloud/projectify@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be stable. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against stable libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE

changelog

Changelog

npm history

5.0.0 (2025-03-07)

⚠ BREAKING CHANGES

  • migrate to Node 18 (#345)

Miscellaneous Chores

4.0.0 (2023-08-09)

⚠ BREAKING CHANGES

  • upgrade to Node 14 (#318)

Bug Fixes

Miscellaneous Chores

3.0.0 (2022-05-20)

⚠ BREAKING CHANGES

  • update library to use Node 12 (#299)

Build System

2.1.1 (2021-09-09)

Bug Fixes

  • build: switch primary branch to main (#267) (9e8d6e4)

2.1.0 (2021-06-10)

Features

  • add gcf-owl-bot[bot] to ignoreAuthors (#245) (30f0499)

2.0.1 (2020-07-06)

Bug Fixes

2.0.0 (2020-03-24)

⚠ BREAKING CHANGES

  • typescript@3.7 introduced some breaking changes
  • drop Node 8 from engines field (#172)

Features

Build System

  • update to latest version of gts/typescript (#171) (30f90cc)

1.0.4 (2019-12-05)

Bug Fixes

  • publish: publication failed to reach npm (#141) (5406ba5)

1.0.3 (2019-12-05)

Bug Fixes

  • deps: pin TypeScript below 3.7.0 (6c95307)

1.0.2 (2019-11-14)

Bug Fixes

1.0.1 (2019-06-26)

Bug Fixes

  • docs: link to reference docs section on googleapis.dev (#119) (90a009f)

1.0.0 (2019-05-02)

Build System

BREAKING CHANGES

  • upgrade engines field to >=8.10.0 (#103)

v0.3.3

03-12-2019 12:27 PDT

This patch release contains a few updates to the docs. That's all!

Documentation

  • docs: update links in contrib guide (#86)
  • docs: update contributing path in README (#82)
  • docs: move CONTRIBUTING.md to root (#81)
  • docs: add lint/fix example to contributing guide (#79)

Internal / Testing Changes

  • build: Add docuploader credentials to node publish jobs (#90)
  • build: use node10 to run samples-test, system-test etc (#89)
  • build: update release configuration
  • chore(deps): update dependency mocha to v6
  • build: use linkinator for docs test (#85)
  • build: create docs test npm scripts (#84)
  • build: test using @grpc/grpc-js in CI (#83)
  • build: ignore googleapis.com in doc link check (#78)
  • build: check for 404s in the docs (#77)
  • chore(build): inject yoshi automation key (#75)
  • chore: update nyc and eslint configs (#74)
  • chore: fix publish.sh permission +x (#72)
  • fix(build): fix Kokoro release script (#71)
  • build: add Kokoro configs for autorelease (#70)
  • chore: always nyc report before calling codecov (#67)
  • chore: nyc ignore build/test by default (#66)
  • chore(build): update prettier config (#64)
  • chore: update license file (#63)
  • fix(build): fix system key decryption (#59)
  • chore: add synth.metadata

v0.3.2

Bug fixes

  • fix: do not replace projectId on stream objects (#53)

Dependencies

  • chore(deps): update dependency gts to ^0.9.0 (#52)

Internal / Testing Changes

  • chore: update eslintignore config (#51)
  • chore: use latest npm on Windows (#50)
  • chore: update CircleCI config (#49)
  • chore: include build in eslintignore (#46)

v0.3.1

Implementation Changes

  • fix: replaceProjectId should not fail when passed a Buffer (#43)

Dependencies

  • chore(deps): update dependency nyc to v13 (#13)
  • chore(deps): lock file maintenance (#11)
  • chore(deps): lock file maintenance (#8)
  • chore(deps): update dependency typescript to v3 (#7)
  • chore(deps): update dependency gts to ^0.8.0 (#2)
  • chore(deps): lock file maintenance (#4)
  • chore(deps): lock file maintenance (#3)

Internal / Testing Changes

  • chore: update issue templates (#40)
  • chore: remove old issue template (#38)
  • build: run tests on node11 (#37)
  • chores(build): run codecov on continuous builds (#34)
  • chores(build): do not collect sponge.xml from windows builds (#35)
  • chore: update new issue template (#33)
  • build: fix codecov uploading on Kokoro (#30)
  • Update kokoro config (#28)
  • Update CI config (#26)
  • Don't publish sourcemaps (#24)
  • build: prevent system/sample-test from leaking credentials
  • Update kokoro config (#22)
  • test: remove appveyor config (#21)
  • Update CI config (#20)
  • Enable prefer-const in the eslint config (#19)
  • Enable no-var in eslint (#18)
  • Update CI config (#17)
  • Add synth and update CI config (#15)
  • chore: ignore package-lock.json (#12)
  • chore: update renovate config (#10)
  • remove that whitespace (#9)
  • chore: assert.deelEqual => assert.deepStrictEqual (#6)
  • chore: move mocha options to mocha.opts (#5)