mirror of
https://gitlab.com/Thoscellen/Wallset.git
synced 2025-05-31 19:04:51 +02:00
Définition du module JS
This commit is contained in:
parent
69ec0da893
commit
67f2a9f474
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Ignore node_module
|
||||||
|
**/node_modules/
|
21
src/build_job/package-lock.json
generated
Normal file
21
src/build_job/package-lock.json
generated
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "build_job",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "build_job",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"node-iptc": "^1.0.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/node-iptc": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-iptc/-/node-iptc-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-+e9aVETp/X8iFX2qBw2GnABkq/jGs7dJdxGURZysOdn4ZdOdArPW2a3xQpSq6GX2CcgEzUklDfaC/cg4sLv35g=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
src/build_job/package.json
Normal file
14
src/build_job/package.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "build_job",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Generate a theme.json file from the images' metadata of the working folder.",
|
||||||
|
"main": "themeset_builder.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "node themeset_builder.js"
|
||||||
|
},
|
||||||
|
"author": "Simon",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"node-iptc": "^1.0.5"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const env = require("process")
|
||||||
|
const iptc = require('node-iptc');
|
||||||
|
|
||||||
|
|
||||||
|
// find all images
|
||||||
|
const slug = env.PACKAGE_NAME || "valid_set";
|
||||||
|
const root = env.ENTRY_FOLDER || "test";
|
||||||
|
let file = path.join(root, slug, "bl2_eridum_badlands_1.jpg");
|
||||||
|
|
||||||
|
// extract metadata from them
|
||||||
|
fs.readFile(file, function (err, data) {
|
||||||
|
if (err) { throw err }
|
||||||
|
var iptc_data = iptc(data);
|
||||||
|
console.log(iptc_data)
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user