Sorry, the diff of this file is not supported yet
| <component name="InspectionProjectProfileManager"> | ||
| <profile version="1.0" is_locked="false"> | ||
| <option name="myName" value="Project Default" /> | ||
| </profile> | ||
| </component> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ProjectModuleManager"> | ||
| <modules> | ||
| <module fileurl="file://$PROJECT_DIR$/.idea/common.iml" filepath="$PROJECT_DIR$/.idea/common.iml" /> | ||
| </modules> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="VcsDirectoryMappings"> | ||
| <mapping directory="$PROJECT_DIR$" vcs="Git" /> | ||
| </component> | ||
| </project> |
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="ChangeListManager"> | ||
| <list default="true" id="8d9c7bdb-8cfc-41d0-900c-a888b1730292" name="Default" comment=""> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" /> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" /> | ||
| <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/test.js" /> | ||
| </list> | ||
| <ignored path="$PROJECT_DIR$/.tmp/" /> | ||
| <ignored path="$PROJECT_DIR$/temp/" /> | ||
| <ignored path="$PROJECT_DIR$/tmp/" /> | ||
| <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> | ||
| <option name="TRACKING_ENABLED" value="true" /> | ||
| <option name="SHOW_DIALOG" value="false" /> | ||
| <option name="HIGHLIGHT_CONFLICTS" value="true" /> | ||
| <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> | ||
| <option name="LAST_RESOLUTION" value="IGNORE" /> | ||
| </component> | ||
| <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> | ||
| <component name="FileEditorManager"> | ||
| <leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> | ||
| <file leaf-file-name="index.js" pinned="false" current-in-tab="true"> | ||
| <entry file="file://$PROJECT_DIR$/lib/index.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="1067"> | ||
| <caret line="111" column="36" lean-forward="false" selection-start-line="111" selection-start-column="36" selection-end-line="111" selection-end-column="36" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="test.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/lib/test.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="-312"> | ||
| <caret line="6" column="5" lean-forward="false" selection-start-line="6" selection-start-column="5" selection-end-line="6" selection-end-column="5" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| <file leaf-file-name="msgColor.js" pinned="false" current-in-tab="false"> | ||
| <entry file="file://$PROJECT_DIR$/lib/msgColor.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="6" lean-forward="false" selection-start-line="0" selection-start-column="6" selection-end-line="0" selection-end-column="6" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </file> | ||
| </leaf> | ||
| </component> | ||
| <component name="FindInProjectRecents"> | ||
| <findStrings> | ||
| <find>todo</find> | ||
| <find>exists</find> | ||
| <find>mkdir</find> | ||
| <find>mkdirSync</find> | ||
| </findStrings> | ||
| </component> | ||
| <component name="Git.Settings"> | ||
| <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> | ||
| </component> | ||
| <component name="IdeDocumentHistory"> | ||
| <option name="CHANGED_PATHS"> | ||
| <list> | ||
| <option value="$PROJECT_DIR$/lib/msgColor.js" /> | ||
| <option value="$PROJECT_DIR$/lib/test.js" /> | ||
| <option value="$PROJECT_DIR$/lib/index.js" /> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" /> | ||
| <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER"> | ||
| <package-json value="$PROJECT_DIR$/package.json" /> | ||
| </component> | ||
| <component name="JsGulpfileManager"> | ||
| <detection-done>true</detection-done> | ||
| <sorting>DEFINITION_ORDER</sorting> | ||
| </component> | ||
| <component name="ProjectFrameBounds"> | ||
| <option name="x" value="4" /> | ||
| <option name="y" value="23" /> | ||
| <option name="width" value="1436" /> | ||
| <option name="height" value="877" /> | ||
| </component> | ||
| <component name="ProjectView"> | ||
| <navigator currentView="ProjectPane" proportions="" version="1"> | ||
| <flattenPackages /> | ||
| <showMembers /> | ||
| <showModules /> | ||
| <showLibraryContents /> | ||
| <hideEmptyPackages /> | ||
| <abbreviatePackageNames /> | ||
| <autoscrollToSource /> | ||
| <autoscrollFromSource /> | ||
| <sortByType /> | ||
| <manualOrder /> | ||
| <foldersAlwaysOnTop value="true" /> | ||
| </navigator> | ||
| <panes> | ||
| <pane id="ProjectPane"> | ||
| <subPane> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="common" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="common" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| <PATH> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="common" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="common" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| <PATH_ELEMENT> | ||
| <option name="myItemId" value="lib" /> | ||
| <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> | ||
| </PATH_ELEMENT> | ||
| </PATH> | ||
| </subPane> | ||
| </pane> | ||
| <pane id="Scratches" /> | ||
| <pane id="Scope" /> | ||
| </panes> | ||
| </component> | ||
| <component name="PropertiesComponent"> | ||
| <property name="WebServerToolWindowFactoryState" value="true" /> | ||
| <property name="last_opened_file_path" value="$PROJECT_DIR$" /> | ||
| <property name="nodejs_interpreter_path" value="/usr/local/bin/node" /> | ||
| </component> | ||
| <component name="RunDashboard"> | ||
| <option name="ruleStates"> | ||
| <list> | ||
| <RuleState> | ||
| <option name="name" value="ConfigurationTypeDashboardGroupingRule" /> | ||
| </RuleState> | ||
| <RuleState> | ||
| <option name="name" value="StatusDashboardGroupingRule" /> | ||
| </RuleState> | ||
| </list> | ||
| </option> | ||
| </component> | ||
| <component name="RunManager" selected="Node.js.index.js"> | ||
| <configuration default="false" name="index.js" type="NodeJSConfigurationType" factoryName="Node.js" temporary="true" path-to-node="project" path-to-js-file="index.js" working-dir="$PROJECT_DIR$/lib"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest"> | ||
| <node-interpreter value="project" /> | ||
| <working-dir value="" /> | ||
| <envs /> | ||
| <scope-kind value="ALL" /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma"> | ||
| <config-file value="" /> | ||
| <node-interpreter value="project" /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor"> | ||
| <config-file value="" /> | ||
| <node-interpreter value="project" /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug"> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir=""> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="cucumber.js" factoryName="Cucumber.js"> | ||
| <option name="cucumberJsArguments" value="" /> | ||
| <option name="executablePath" /> | ||
| <option name="filePath" /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js"> | ||
| <node-interpreter>project</node-interpreter> | ||
| <node-options /> | ||
| <gulpfile /> | ||
| <tasks /> | ||
| <arguments /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="js.build_tools.npm" factoryName="npm"> | ||
| <command value="run" /> | ||
| <scripts /> | ||
| <node-interpreter value="project" /> | ||
| <envs /> | ||
| <method /> | ||
| </configuration> | ||
| <configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha"> | ||
| <node-interpreter>project</node-interpreter> | ||
| <node-options /> | ||
| <working-directory /> | ||
| <pass-parent-env>true</pass-parent-env> | ||
| <envs /> | ||
| <ui /> | ||
| <extra-mocha-options /> | ||
| <test-kind>DIRECTORY</test-kind> | ||
| <test-directory /> | ||
| <recursive>false</recursive> | ||
| <method /> | ||
| </configuration> | ||
| <list size="1"> | ||
| <item index="0" class="java.lang.String" itemvalue="Node.js.index.js" /> | ||
| </list> | ||
| <recent_temporary> | ||
| <list size="1"> | ||
| <item index="0" class="java.lang.String" itemvalue="Node.js.index.js" /> | ||
| </list> | ||
| </recent_temporary> | ||
| </component> | ||
| <component name="ShelveChangesManager" show_recycled="false"> | ||
| <option name="remove_strategy" value="false" /> | ||
| </component> | ||
| <component name="TaskManager"> | ||
| <task active="true" id="Default" summary="Default task"> | ||
| <changelist id="8d9c7bdb-8cfc-41d0-900c-a888b1730292" name="Default" comment="" /> | ||
| <created>1495428761651</created> | ||
| <option name="number" value="Default" /> | ||
| <option name="presentableId" value="Default" /> | ||
| <updated>1495428761651</updated> | ||
| <workItem from="1495428762880" duration="1858000" /> | ||
| <workItem from="1495431928887" duration="5552000" /> | ||
| </task> | ||
| <servers /> | ||
| </component> | ||
| <component name="TimeTrackingManager"> | ||
| <option name="totallyTimeSpent" value="7410000" /> | ||
| </component> | ||
| <component name="ToolWindowManager"> | ||
| <frame x="4" y="23" width="1436" height="877" extended-state="6" /> | ||
| <layout> | ||
| <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25322813" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3299363" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3299363" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> | ||
| <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> | ||
| <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> | ||
| </layout> | ||
| </component> | ||
| <component name="TypeScriptGeneratedFilesManager"> | ||
| <option name="processedProjectFiles" value="true" /> | ||
| </component> | ||
| <component name="VcsContentAnnotationSettings"> | ||
| <option name="myLimit" value="2678400000" /> | ||
| </component> | ||
| <component name="XDebuggerManager"> | ||
| <breakpoint-manager> | ||
| <option name="time" value="9" /> | ||
| </breakpoint-manager> | ||
| <watches-manager /> | ||
| </component> | ||
| <component name="editorHistoryManager"> | ||
| <entry file="file://$PROJECT_DIR$/lib/index.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/lib/msgColor.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="6" lean-forward="false" selection-start-line="0" selection-start-column="6" selection-end-line="0" selection-end-column="6" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/test.js" /> | ||
| <entry file="file://$PROJECT_DIR$/lib/msgColor.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="0"> | ||
| <caret line="0" column="6" lean-forward="false" selection-start-line="0" selection-start-column="6" selection-end-line="0" selection-end-column="6" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/lib/test.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="-312"> | ||
| <caret line="6" column="5" lean-forward="false" selection-start-line="6" selection-start-column="5" selection-end-line="6" selection-end-column="5" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| <entry file="file://$PROJECT_DIR$/lib/index.js"> | ||
| <provider selected="true" editor-type-id="text-editor"> | ||
| <state relative-caret-position="1067"> | ||
| <caret line="111" column="36" lean-forward="false" selection-start-line="111" selection-start-column="36" selection-end-line="111" selection-end-column="36" /> | ||
| <folding /> | ||
| </state> | ||
| </provider> | ||
| </entry> | ||
| </component> | ||
| </project> |
+63
| const fs = require('fs'); | ||
| // const path = require('path'); | ||
| class createFile { | ||
| constructor(root, suffix) { | ||
| this.root = root; | ||
| this.arr = []; | ||
| this.suffix = suffix; | ||
| } | ||
| create(dir,message) { | ||
| const _this=this; | ||
| var array = dir.split('/'); | ||
| var dirArray = []; | ||
| for (let _dir of array) { | ||
| dirArray.push(`${dirArray[dirArray.length-1||0]||''}${_dir}/`); | ||
| } | ||
| // dirArray.pop(); | ||
| this.createDir(dirArray).then(()=>{ | ||
| _this._createFile(dir,message).then(console.log('end')); | ||
| }); | ||
| } | ||
| createDir(array){ | ||
| const _this=this; | ||
| return new Promise((resolve,reject)=>{ | ||
| _this._createDir(array,0,(file)=>{ | ||
| resolve(file); | ||
| }); | ||
| }) | ||
| } | ||
| _createDir(array,index,callback){ | ||
| const _this= this; | ||
| if(index < array.length-1){ | ||
| // 下标小于length说明还在递归目录 | ||
| fs.mkdir(array[index],0o777, function(){ | ||
| console.log(`${array[index]}创建完毕`) | ||
| index+=1; | ||
| _this._createDir(array,index,callback); | ||
| }) | ||
| }else { | ||
| // 最后一个 | ||
| callback(array[index]) | ||
| } | ||
| } | ||
| _createFile(file,message){ | ||
| return new Promise((resolve,reject)=>{ | ||
| fs.writeFile(file, message, (err) => { | ||
| if (err) { | ||
| reject(err); | ||
| } | ||
| resolve(); | ||
| }); | ||
| }); | ||
| } | ||
| } | ||
| const A = new createFile(); | ||
| const a = 'aa/bb/cc/ff.json'; | ||
| A.create(a,'123'); | ||
| // module.exports = getFile; |
+5
-5
@@ -32,9 +32,9 @@ /* | ||
| read: function(file, callback) { | ||
| fs.readFile(file, 'utf8', (err, data) => { | ||
| return new Promise((resolve,reject)=>{ | ||
| fs.readFile(file, 'utf8', (err, data) => { | ||
| if (err) { | ||
| throw err; | ||
| reject(err); | ||
| } | ||
| if (callback) { | ||
| callback(data); | ||
| } | ||
| resolve(data); | ||
| }); | ||
| }); | ||
@@ -41,0 +41,0 @@ }, |
+1
-1
| { | ||
| "name": "cpwcom", | ||
| "version": "1.0.7", | ||
| "version": "1.0.8", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
26218
320.36%11
120%269
26.89%3
50%