code: public void mkPackage(String pkgName, File dir) {
          try {
              File metaDir = new File(dir + "/.mdw");
              if (!metaDir.exists() && !metaDir.mkdirs())
                  throw new IOException("Cannot create directory: " + metaDir.getAbsolutePath());
              File pkgFile = new File(metaDir + "/package.yaml");
              if (!pkgFile.exists()) {
                  JSONObject pkgJson = new JSONObject();
                  pkgJson.put("name", pkgName);
                  pkgJson.put("version", "1.0.01");
                  pkgJson.put("schemaVersion", "6.1");
                  Files.write(Paths.get(pkgFile.getPath()), pkgJson.toString(2).getBytes());
              }
          }
          catch (IOException ex) {
              ex.printStackTrace();
          }
      }
docs: Creates a package if it doesn't exist. Only works from 6.1.