
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Angular2+ wrapper for the WooCommerce API
Please note this library is not yet pubished or active, it is currently being developed. Visit the Discord Channel if you have an idea or feature request for this project.
To install this library, run:
$ npm install woo-wrapper --save (not yet published)
Import woo-wrapper in any Angular application by running:
$ npm install woo-wrapper (not yet published)
and then from your Angular AppModule
:
...
// Import WaNG
import { WooApiModule, WooApiService } from 'woo-wrapper';
// Add your WooCommerce Credentials
const WooCommerceConfig = {
url: 'your_site_url',
consumerKey: 'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXX',
consumerSecret: 'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
wpAPI: true,
version: 'wc/v1'
};
@NgModule({
declarations: [...],
imports: [
...
// Specify as an import and pass in your config
WooApiModule.forRoot(WooCommerceConfig)
],
// Add the Api service to the provider
providers: [WooApiService]
})
export class AppModule { }
Once woo-wrapper is imported, you can use the WooApiService
:
import { Component, OnInit } from '@angular/core';
// Import the services
import { WooApiService } from 'woo-wrapper';
@Component({...})
export class HomePage implements OnInit {
products: any;
// Inject the service
constructor(private woo: WooApiService) { }
ngOnInit(): void {
// Fetch all products
this.woo.fetchItems('products')
.then(products => console.log(products));
}
}
fetchItems(itemType)
string
(required) - the type of WooCommerce item you want to fetch (products, orders, customers, categories). Accepts query parameters, see the WooCommerce Api docs for a full list of query parameters.Promise
Example
this.woo.fetchItems('products')
.then(products => console.log(products));
To generate all *.js
, *.js.map
and *.d.ts
files:
$ npm run tsc
To lint all *.ts
files:
$ npm run lint
MIT © Michael Doye
FAQs
Very simple Angular2+ wrapper for the WooCommerce API
The npm package ng2woo receives a total of 0 weekly downloads. As such, ng2woo popularity was classified as not popular.
We found that ng2woo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.