nestjs / azure-storage

Azure Storage module for Nest framework (node.js) ☁️
https://nestjs.com
MIT License
87 stars 35 forks source link

(feature) add module asynchronous config using factory/existing/class #65

Closed ksivamuthu closed 4 years ago

ksivamuthu commented 5 years ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

Added the async configuration method to the module, so that the azure table storage options can be injected into the module using a provider or factory.

Issue Number: #36

What is the new behavior?

The new behavior is

const storageConfigFactory = async () => {
  sasKey: process.env['AZURE_STORAGE_SAS_KEY'],
  accountName: process.env['AZURE_STORAGE_ACCOUNT'],
  containerName: 'nest-demo-container',
};

@Module({
  controllers: [AppController],
  providers: [AppService],
  imports: [
    AzureStorageModule.withConfigAsync({
      useFactory: storageConfigFactory,
    }),
  ],
})
export class AppModule {}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

kurpav commented 4 years ago

Any plans to merge it?

ksivamuthu commented 4 years ago

@kamilmysliwiec @manekinekko Any plans on merging this?

lukazlatecan commented 4 years ago

Any news on this?

manekinekko commented 4 years ago

Thank you @ksivamuthu for sending this PR.

gergelybodor commented 3 years ago

When will this be released to npm? The latest version which is 2.1.1 doesn't have this feature.

stijnswaanen commented 3 years ago

yes, can this please be released to npm asap? Thx

f5hajnal commented 3 years ago

I was able to properly incorporate this to my project as a "helper" module. It works like a charm. However it would be amazing to see this be actually shipped to the latest npm version of the package... More than 6 months now since it's approval. Thanks!