Skip to content

Support environments that cannot require json files #959

@LorenzGardner

Description

@LorenzGardner

https://github.com/felixge/node-mysql/blob/master/lib/ConnectionConfig.js#L127

   SSLProfiles = require('./../fixtures/ssl-profiles.json');

Not all environments support json files with the require (specifically nexe).

The usage seems weird to me, I guess it has been in node for a while (since 2011) but I would like to change the line to

  SSLProfile = JSON.parse(fs.readFileSync('./../fixtures/ssl-profiles.json'));

You may note this is indeed the implementation of require for JSON files:
nodejs/node-v0.x-archive@588d885

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions