How to create meta files without unity / unity api

Hi,
so a meta file is something like this:

fileFormatVersion: 2 --> magic 2, think its just a version number of meta format
guid: --> is this just a guid like from visual studio without the - ? MAIN Question here!
folderAsset: yes --> ya, if its a folder
DefaultImporter: --> some blabla
externalObjects: {}
userData: 
assetBundleName: 
assetBundleVariant: 

Is it possible to just create such a textfile an generate a guid in visual studio (removing the - ) ?? Or does Unity do some magic to generate the guid ?

why: Its for creating custom registry npm packages. Where every file/folder has to have a meta but is not part of a unity project…

Greetings
Philipp

  1. yes the GUID is just a 128 bit hex-encoded value. important: ensure it is unique
  2. beware that the DefaultImporter only applies to folders. other asset types (e.g. textures) have their own importers and their .meta is wildly different.
    e.g: this is for a script:
    meta file
fileFormatVersion: 2
guid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:

texture:
huge meta file with all the import settings

fileFormatVersion: 2
guid: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
timeCreated: 1435262664
licenseType: Pro
TextureImporter:
  fileIDToRecycleName: {}
  serializedVersion: 2
  mipmaps:
    mipMapMode: 0
    enableMipMap: 0
    linearTexture: 0
    correctGamma: 0
    fadeOut: 0
    borderMipMap: 0
    mipMapFadeDistanceStart: 1
    mipMapFadeDistanceEnd: 3
  bumpmap:
    convertToNormalMap: 0
    externalNormalMap: 0
    heightScale: .25
    normalMapFilter: 0
  isReadable: 0
  grayScaleToAlpha: 0
  generateCubemap: 0
  cubemapConvolution: 0
  cubemapConvolutionSteps: 8
  cubemapConvolutionExponent: 1.5
  seamlessCubemap: 0
  textureFormat: -3
  maxTextureSize: 2048
  textureSettings:
    filterMode: 2
    aniso: 16
    mipBias: -1
    wrapMode: 1
  nPOTScale: 0
  lightmap: 0
  rGBM: 0
  compressionQuality: 50
  spriteMode: 1
  spriteExtrude: 1
  spriteMeshType: 1
  alignment: 0
  spritePivot: {x: .5, y: .5}
  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
  spritePixelsToUnits: 100
  alphaIsTransparency: 1
  textureType: 8
  buildTargetSettings: []
  spriteSheet:
    sprites: []
  spritePackingTag:
  userData:
  assetBundleName:
  assetBundleVariant:

etc…

it also depends on the Unity version

So for complex assets like textures, prefabs… i go the unity way, but for simple folders, changelog… its possible to simply create one…

Thanks!