finki-main
main
|
Last change
on this file since 81bc7da was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago |
|
Initial commit
|
-
Property mode
set to
100644
|
|
File size:
444 bytes
|
| Line | |
|---|
| 1 | import process from 'process';
|
|---|
| 2 |
|
|---|
| 3 | const packageJson = process.env.npm_package_json;
|
|---|
| 4 | const userAgent = process.env.npm_config_user_agent;
|
|---|
| 5 | const isNpm6 = Boolean(userAgent && userAgent.startsWith('npm'));
|
|---|
| 6 | const isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json'));
|
|---|
| 7 |
|
|---|
| 8 | const isNpm = isNpm6 || isNpm7;
|
|---|
| 9 | const isYarn = Boolean(userAgent && userAgent.startsWith('yarn'));
|
|---|
| 10 | const isNpmOrYarn = isNpm || isYarn;
|
|---|
| 11 |
|
|---|
| 12 | export default isNpmOrYarn;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.