Move platform.json in accessible place
See original GitHub issueWhat are you trying to achieve?
I want programmatically to check sharp installed platform in node_modules. The only place that show this is platform.json
to check is it right sharp platform installed in node_modules its need to write function like this:
function checkInstalledSharpPlatform(targetPlatform, arch) {
let shrapPath = require.resolve('sharp');
shrapPath = path.join(shrapPath,'..','..','vendor','8.11.3','darwin-arm64v8','platform.json');
if (!fs.existsSync(shrapPath)) {
return false;
}
const data = fs.readFileSync(shrapPath, 'utf8');
return data === '"' + targetPlatform + '-' + arch + '"';
}
but this function is not robust (8.11.3
folder or darwin-arm64v8
will be changed in the next sharp versions). Can we have platform.json in better place? (like node_modules/sharp/platform.json)
Have you searched for similar feature requests? YES
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Loading JSON data from Cloud Storage | BigQuery
You can load newline delimited JSON data from Cloud Storage into a new table or partition, or append to or overwrite an existing...
Read more >Working with JSON in Swift - Swift Blog - Apple Developer
You can use the Foundation framework's JSONSerialization class to convert JSON into Swift data types like Dictionary, Array, String, Number, and ...
Read more >User and Workspace Settings - Visual Studio Code
Depending on your platform, the user settings file is located here: Windows %APPDATA%\Code\User\settings.json; macOS $HOME/Library/Application\ Support/Code/ ...
Read more >Semi-Structured JSON Data Handling Automation in Snowflake
This requires some technical skills, however, along with knowledge about the JSON structure being queried. So, many organizations deploy views ...
Read more >3+ Ways for Reading Local JSON Files with Angular 15
Anything you place in the assets folder in the Angular app will be accessible in the browser by default, and you may even...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Added as
sharp.vendor
via commit https://github.com/lovell/sharp/commit/3da258f6fb1446bc8596070d06119e31c621a073Example output:
This will be in v0.30.0.
v0.30.0 now available with this feature.