vanitygen.js 694 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env node
  2. /* eslint-disable @typescript-eslint/no-var-requires */
  3. // Copyright 2017-2019 @polkadot/app-accounts authors & contributors
  4. // This software may be modified and distributed under the terms
  5. // of the Apache-2.0 license. See the LICENSE file for details.
  6. const fs = require('fs');
  7. const path = require('path');
  8. const [compiled] = ['../vanitygen/cli.js']
  9. .map((file) => path.join(__dirname, file))
  10. .filter((file) => fs.existsSync(file));
  11. if (compiled) {
  12. require(compiled);
  13. } else {
  14. require('@babel/register')({
  15. extensions: ['.js', '.ts'],
  16. plugins: [
  17. ['module-resolver', {
  18. alias: {}
  19. }]
  20. ]
  21. });
  22. require('../src/vanitygen/cli.ts');
  23. }