Parameters are not passed to store 'create' function #30

Open
opened 2020-08-08 15:13:01 +00:00 by Ghost · 1 comment

index.js

var greenlock = Greenlock.create({
  packageRoot: ${__dirname},
  maintainerEmail: 'my@email.com',
  staging: true,
  store: {
    module: __dirname + '/../src/le-store.js',
    customProp: 'value'
  }
});

le-store.js

module.exports.create = function (options, a, b, c) {
  console.log(this, options, a, b, c);

Output

{ create: [Function] } { module: '/Users/kraku/dev/project1/form/build/../src/le-store.js',
  packageRoot: '/Users/kraku/dev/project1/form/build/..',
  basePath: '/Users/kraku/dev/project1/form/greenlock.d',
  directoryUrl: 'https://acme-v02.api.letsencrypt.org/directory' } undefined undefined undefined
index.js ```js var greenlock = Greenlock.create({ packageRoot: ${__dirname}, maintainerEmail: 'my@email.com', staging: true, store: { module: __dirname + '/../src/le-store.js', customProp: 'value' } }); ``` le-store.js ```js module.exports.create = function (options, a, b, c) { console.log(this, options, a, b, c); ``` Output ``` { create: [Function] } { module: '/Users/kraku/dev/project1/form/build/../src/le-store.js', packageRoot: '/Users/kraku/dev/project1/form/build/..', basePath: '/Users/kraku/dev/project1/form/greenlock.d', directoryUrl: 'https://acme-v02.api.letsencrypt.org/directory' } undefined undefined undefined ```
Author

You pass values to your custom store like you did with customProp, which you can then access from create() via options.customProp. create() only ever gets called with the one parameter.

You pass values to your custom store like you did with `customProp`, which you can then access from `create()` via `options.customProp`. `create()` only ever gets called with the one parameter.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock.js#30
No description provided.