wpgpotholes-utils
v1.0.42
Published
Library for shared resources across wpgpotholes projects
Downloads
16
Readme
Installation
To install the lastest version:
npm install wpgpotholes-utils
To install a specific version:
npm install wpgpotholes-utils@version number
Getting started
import { UsersService, PotholesService } from "wpgpotholes-utils";
class App extends Component {
constructor(props) {
super(props);
};
createServices = () => {
const backend_endpoint = "http://localhost:8000";
this.usersService = new UsersService(backend_endpoint);
this.potholesService = new PotholesService(backend_endpoint);
console.log(`UsersService hosted on: ${this.usersService.getHost()}`);
console.log(`PotholesService hosted on: ${this.potholesService.getHost()}`
// UsersService hosted on: http://localhost:8000
// PotholesService hosted on: http://localhost:8000
);
};
Making changes
After updating any of the files in this directory, you'll have to run a few commands to publish the npm package:
Log into npm via terminal by running
npm login
If you don't have an account, you can create one here
After logging in, you should be able to run
npm whoami
which should return your usernameRun
npm version
to get the current package versionChange the version by running
npm version <version number>
Guidelines for versioning can be found here
Run
npm publish
Now you're all set to go. You should be able to navigate to your project and install the package :+1: