i set the default config for the package.json file using the command,
npm config set init-main "script.js"
after this i initialized a folder using
npm init --yes
but the main is still "index.js". But, if i write
npm config get init-main
it returns "script.js". I could not find anything related in the documentation. Please help. Thanks in advance.
Unfortunately,
npm config set
allows you to set anything, eg. you can do something like:You probably just want to edit in
package.json
the fieldmain
to"index.js"
, there does not appear to exist any such config for npm (noinit-main
described https://docs.npmjs.com/misc/config). Maybe an older/unstable verion had it?(npm config should probably show a warning or somerhing in this case, like "warning, unrecognized config 'init-main'", but it doesn't...)