1 changed files with 18 additions and 0 deletions
@ -0,0 +1,18 @@ |
|||||||
|
#!/usr/bin/env node |
||||||
|
let input = []; |
||||||
|
|
||||||
|
process.stdin.resume(); |
||||||
|
process.stdin.setEncoding('utf8'); |
||||||
|
|
||||||
|
process.stdin.on('data', (data) => { |
||||||
|
input.push(data); |
||||||
|
}); |
||||||
|
|
||||||
|
process.stdin.on('end', () => { |
||||||
|
const str = input.join(''); |
||||||
|
const pages = JSON.parse(str); |
||||||
|
|
||||||
|
pages.forEach(({ id }, index) => { |
||||||
|
console.log(`pages[${index}]="${id}"`); |
||||||
|
}); |
||||||
|
}); |
||||||
Loading…
Reference in new issue