Skip to content

Commit

Permalink
docs(lib): rename model to plugin remove new and add await keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
manushak committed Feb 29, 2024
1 parent 5fa4671 commit 3c0c2fe
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/lib/ccf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can see example Typescript invocations for each `cloud/vendor` below:
import {CloudCarbonFootprint} from '@grnsft/if-unofficial-plugins';

const ccf = CloudCarbonFootprint({interpolation: Interpolation.LINEAR});
const results = ccf.execute([
const results = await ccf.execute([
{
timestamp: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp
duration: 3600, // duration institute
Expand All @@ -70,8 +70,8 @@ const results = ccf.execute([
```typescript
import {CloudCarbonFootprint} from '@grnsft/if-unofficial-plugins';

const ccf = new CloudCarbonFootprint();
const results = ccf.execute([
const ccf = CloudCarbonFootprint();
const results = await ccf.execute([
{
timestamp: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp
duration: 3600, // duration institute
Expand All @@ -87,8 +87,8 @@ const results = ccf.execute([
```typescript
import {CloudCarbonFootprint} from '@grnsft/if-unofficial-plugins';

const ccf = new CloudCarbonFootprint();
const results = ccf.execute([
const ccf = CloudCarbonFootprint();
const results = await ccf.execute([
{
timestamp: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp
duration: 3600, // duration institute
Expand Down
12 changes: 6 additions & 6 deletions src/lib/co2js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Plugin global config

- `options`: **SWD Model Only** an object containing any Sustainable Web Design specific variables to the changed. All keys are optional.
- `options`: **SWD Plugin Only** an object containing any Sustainable Web Design specific variables to the changed. All keys are optional.
- `dataReloadRatio` - a value between 0 and 1 representing the percentage of data that is downloaded by return visitors. -`firstVisitPercentage` - a value between 0 and 1 representing the percentage of new visitors.
- `returnVisitPercentage` - a value between 0 and 1 representing the percentage of returning visitors.
- `gridIntensity` - an object that can contain the following optional keys:
Expand Down Expand Up @@ -94,13 +94,13 @@ This yields a result that looks like the following (saved to `/outputs/co2js.yml

```yaml
name: co2js-demo
description: example manifest invoking CO2.JS model
description: example manifest invoking CO2.JS plugin
tags: null
initialize:
plugins:
co2js:
path: '@grnsft/if-unofficial-models'
model: Co2js
path: '@grnsft/if-unofficial-plugins'
method: Co2js
global-config:
options:
dataReloadRatio: 0.6
Expand Down Expand Up @@ -153,7 +153,7 @@ const globalConfig = {
},
};
const co2js = Co2js(globalConfig);
const results = co2js.execute(
const results = await co2js.execute(
[
{
duration: 3600, // duration institute
Expand All @@ -174,7 +174,7 @@ const results = co2js.execute(
import {Co2js} from '@grnsft/if-unofficial-plugins';
const co2js = Co2js();
const results = co2js.execute(
const results = await co2js.execute(
[
{
duration: 3600, // duration institute
Expand Down
2 changes: 1 addition & 1 deletion src/lib/teads-aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Resulting values are an estimate based on the testing done by Teads' Engineering
import {TeadsAWS} from '@grnsft/if-unofficial-plugins';

const teads = TeadsAWS({});
const results = teads.execute([
const results = await teads.execute([
{
duration: 3600, // duration institute
timestamp: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp
Expand Down
4 changes: 2 additions & 2 deletions src/lib/teads-curve/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {TeadsCurve} from '@grnsft/if-unofficial-plugins';
const teads = TeadsCurve({
'cpu/thermal-design-power': 100, // cpu/thermal-design-power of the CPU
});
const results = teads.execute([
const results = await teads.execute([
{
duration: 3600, // duration institute
timestamp: '2021-01-01T00:00:00Z', // ISO8601 / RFC3339 timestamp
Expand All @@ -66,7 +66,7 @@ Resulting values are an estimate based on the testing done by Teads' Engineering
import {TeadsCurve, Interpolation} from '@grnsft/if-unofficial-plugins';

const teads = TeadsCurve({interpolation: Interpolation.SPLINE});
const results = teads.execute(
const results = await teads.execute(
[
{
duration: 3600, // duration institute
Expand Down
7 changes: 3 additions & 4 deletions src/lib/watt-time/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,17 @@ WattTime API requires activation of subscription before usage. Please refer to t
// export WATT_TIME_USERNAME=test1
// export WATT_TIME_PASSWORD=test2
// use environment variables to configure the plugin
const output = await WattTimeGridEmissions({
const output = WattTimeGridEmissions({
username: process.env.WATT_TIME_USERNAME,
password: process.env.WATT_TIME_PASSWORD,
});
const inputs = [
const result = await output.execute([
{
timestamp: '2021-01-01T00:00:00Z',
geolocation: '43.22,-80.22',
duration: 3600,
},
];
const results = output.execute(inputs);
]);
```

### manifest Usage
Expand Down

0 comments on commit 3c0c2fe

Please sign in to comment.