Skip to content

Commit 8634c51

Browse files
author
antialias
committed
using module syntax because require is no longer supported
1 parent 3300e04 commit 8634c51

File tree

16 files changed

+60
-62
lines changed

16 files changed

+60
-62
lines changed

index.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
#!/usr/bin/env node
2-
3-
require('dotenv').config();
4-
const pkg = require('./package.json');
5-
const lib = require('./lib');
6-
const program = require('commander');
7-
const chalk = require('chalk');
8-
const path = require('path');
1+
#!/usr/bin/env noderequire('dotenv').config();
2+
import pkg from './package.json';
3+
import lib from './lib';
4+
import program from 'commander';
5+
import chalk from 'chalk';
6+
import path from 'path';
97

108
const normalizeTheme = (value, defaultValue) => {
119
const theme = value || defaultValue;

lib/builder/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const themeServer =
22
process.env.THEME_SERVER || 'https://themes.jsonresume.org/theme/';
3-
const fs = require('fs');
4-
const request = require('superagent');
5-
const chalk = require('chalk');
6-
const renderHtml = require('../render-html');
3+
import fs from 'fs';
4+
import request from 'superagent';
5+
import chalk from 'chalk';
6+
import renderHtml from '../render-html';
77

88
const denormalizeTheme = (value) => {
99
return value.match(/jsonresume-theme-(.*)/)[1];

lib/export-resume/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
const fs = require('fs');
2-
const path = require('path');
3-
const puppeteer = require('puppeteer');
4-
const btoa = require('btoa');
5-
6-
const renderHtml = require('../render-html');
1+
import fs from 'fs';
2+
import path from 'path';
3+
import puppeteer from 'puppeteer';
4+
import btoa from 'btoa';
5+
import renderHtml from '../render-html';
76

87
module.exports = (resumeJson, fileName, theme, format, callback) => {
98
if (!fileName) {

lib/init.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const fs = require('fs');
2-
const read = require('read');
3-
const resumeJson = require('resume-schema/sample.resume.json');
4-
const chalk = require('chalk'); // slowly replace colors with chalk
1+
import fs from 'fs';
2+
import read from 'read';
3+
import resumeJson from 'resume-schema/sample.resume.json';
4+
import chalk from 'chalk'; // slowly replace colors with chalk
55

66
const fillInit = () => {
77
console.log(

lib/pre-flow/check-pkg-version.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const fs = require('fs');
2-
const request = require('superagent');
3-
const pkg = require('../../package.json');
4-
const chalk = require('chalk');
1+
import fs from 'fs';
2+
import request from 'superagent';
3+
import pkg from '../../package.json';
4+
import chalk from 'chalk';
55

66
module.exports = (results, callback) => {
77
const config = results.getConfig || {};

lib/pre-flow/get-config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fs = require('fs');
1+
import fs from 'fs';
22
const homeDirectory =
33
process.env[process.platform == 'win32' ? 'USERPROFILE' : 'HOME'];
44

lib/pre-flow/get-resume.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const fs = require('fs');
2-
const jsonlint = require('jsonlint');
1+
import fs from 'fs';
2+
import jsonlint from 'jsonlint';
33

44
module.exports = (callback) => {
55
let jsonLocation = './resume.json';

lib/pre-flow/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const getConfig = require('./get-config');
2-
const getResume = require('./get-resume');
3-
const validateSchema = require('./validate-schema');
4-
const checkPkgVersion = require('./check-pkg-version');
5-
const async = require('async');
1+
import getConfig from './get-config';
2+
import getResume from './get-resume';
3+
import validateSchema from './validate-schema';
4+
import checkPkgVersion from './check-pkg-version';
5+
import async from 'async';
66
// This is the first argument for the async.auto function that runs before all commands.
77
module.exports = (callback) => {
88
async.auto(

lib/pre-flow/validate-schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const test = require('../test.js');
1+
import test from '../test.js';
22

33
module.exports = async (results, callback) => {
44
const options = process.argv.slice(2);

lib/pre.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const fs = require('fs');
1+
import fs from 'fs';
22
const homeDirectory =
33
process.env[process.platform == 'win32' ? 'USERPROFILE' : 'HOME'];
4-
const jsonlint = require('jsonlint');
5-
const chalk = require('chalk');
4+
import jsonlint from 'jsonlint';
5+
import chalk from 'chalk';
66

77
module.exports = {
88
getConfig(callback) {

0 commit comments

Comments
 (0)